home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_code1
/
db3v
/
demo1.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1993-10-03
|
10KB
|
221 lines
Form1
Customer Information
Form1
Label10
Account Number:
AccountNumber
Label1
Last Name:
LastName
Label2
First Name:
FirstName
Label3
MiddleInitial
Label4
Address:
Address
Label5
City:
Label6
State:
State
Label7
Label8
Telephone:
Phone
Customer
DBENGINE
Label9
Notes:
Notes
TopButton
NextButton
InsertButton
Insert
DeleteButton
Delete
BottomButton
Bottom
PreviousButton
Previous
UpdateButton
Update
ClearButton
Clear
MNU_File
&File
MNU_Create
&Create Customer Database
MNU_Quit
&Quit
Form_Click
@ Form_Load
AddressBookE
Action
OpenTable
GetRecord
FillForm
Form_Unload
Cancel
CloseTable
FieldName
GetField
LastName
FieldValue
FirstName@
TopButton_Click
FirstRecord
InsertButton_Click
PutField
InsertRecord
ClearButton_Click
MiddleInitial
UpdateButton_Click@
UpdateRecord4
@ InsertRec
@ UpdateRec
Address
State^
Phone
Notesv
BottomButton_Click^
LastRecord
NextButton_Click
NextRecord
PreviousButton_Click
PreviousRecord
DeleteButton_Click
DeleteRecord
MNU_Quit_Click|
DTBL_Error
Reaction
LastName_Change
LastName_LostFocus
MNU_SearchFirst_Click
MNU_SearchLast_Click
CustomerQ
AccountNumber3
TableName
IndexID
SaveEveryChange
False
DBENG_Error
FormToRecord
MNU_Create_Click
NFields
FieldNames
FieldTypes
CreateTable
IndexNFields
CreateIndex
TableFieldNames
TableFieldTypes
TableType
Paradox40
Form_Load
C:\CUSTOMER"
Form_Unload
FillForm
Here we wish to develop a subroutine that fills in our
Address Book form with the information present in thee
current record of our database
Notice that this Subroutine is not position dependentt
It always fills in the form with the information present
in the current record.
We will use other routines to move around in the databasee
table. We can then call this routine to fill in our form..
This routine is reusable!!
Get the current record.
Account Number
Last Name"
First Name
Middle Initial
Address"
State"
Phone"
Notes"
TopButton_Click
This code will make the current record the first recordd
in the table.
It will then fill our form with the data present in thee
first record..
ClearButton_Click
Here we simply clear all the fields on the form.
There are no database specific routines involved here.
InsertButton_Click
This subroutine inserts a record into our database.t
Transfer info from form to current record.
Insert the record
If an error
UpdateButton_Click
This subroutine updates a record in our database.
Transfer info from form to record
Update recordf
if error
InsertRec
This subroutine inserts a record into our Address Book
database. It takes information present on the form and
INSERTS it into the database
Account Number
Last Name"
First Name
Middle Initial
Address"
State"
Phone"
Notes"
UpdateRec
This subroutine updates a record in our Address Book
database. It takes information present on the form and
UPDATES the current record in the database
Account Number
Last Name"
First Name
Middle Initial
Address"
State"
Phone"
Notes"
BottomButton_Click
NextButton_Click
PreviousButton_Click
DeleteButton_Click
MNU_Quit_Click
DBENG_Error
Error code:"
-Insufficient password rights!
Error code:"
-Invalid table!!
Error code:"
-End of table!
Error code:"
-Start of table!
Error code:"
-Unknown error!"
FormToRecord
This subroutine transfers the information present in the
Customer Information form to the database's current record.n
Account Number
Target database field
Target field value
Place it in the Accounte
Number field in thei
current record.
Do the same three-step process for each remaining field in the Customer
Information form.-
Last Name"
First Name
Middle Initial
Address"
State"
Phone"
Notes"
MNU_Create_Click
We will create the CUSTOMER table here in the root directory on drive CC
C:\CUSTOMER"
Account Number,Last Name,First Name,Middle Initial,Address,City,State,Zip,Phone,Notes"
N,A30,A20,A1,A50,A30,A2,A10,A14,M200
Now create the primary index
C:\CUSTOMER"