home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_code1
/
db3v
/
demo2.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1993-10-03
|
10KB
|
227 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^
LastRecordZ
NextButton_Click
NextRecord
PreviousButton_Click
PreviousRecord
DeleteButton_Click
DeleteRecord
MNU_Quit_Click|
DTBL_Error
Reaction
LastName_Change
LastName_LostFocus
MNU_SearchFirst_ClickK
MNU_SearchLast_Click
CustomerQ
AccountNumber
TableName#
IndexID
SaveEveryChange
False
AccountNumber_Change
AccountNumber_LostFocus<
TempA
SearchMode
SearchFirst
SearchField
AccountNmber1
DBENG_Error
FormToRecord
subroutine
inserts
recordS
intof
database
MNU_Create_Click
NFields
TableFieldNames
TableFieldTypes
CreateTable
IndexNFields
CreateIndex
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..
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
BottomButton_Click
NextButton_Click
PreviousButton_Click
DeleteButton_Click
MNU_Quit_Click
AccountNumber_LostFocus
This LostFocus routine is used to search on thee
Account Number field for a specific user suppliedd
Account Number. If the Account Number the user suppliess
is not found in the database table, the form is cleared,
the user supplied Account Number is placed back into the
Account Number field, and we will assume that we are enteringg
a new account.
Temporary variable to hold user typed Account Number
Save user supplied Account Number in Temp var.
Account Number
We will search on the Account Number field.m
We will search for the value the user enteredu
Submit the search criteria by placing the
value to be searched for into the DataTablev
custom control's record buffer.
We will search for the first match
starting at the first record in the table.
Begin search
Search failed to find a match, clear the forms
Restore user supplied Account Number
Begin to process new account infor
Search was successfull, get the record
Fill in the form with the informationl
DBENG_Error
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 C
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"