File: ...\Samples\Solution\Forms\Single.scx
This sample illustrates the simplest scenario for a single-user, single-table data entry form.
The ControlSource property of each of the text boxes and combo boxes on the form is set to a field in the Customer table.
An APPEND BLANK command is issued in the Click event of cmdNew.
В | Copy Code |
---|---|
APPEND BLANK THISFORM.Refresh |
The DELETE command is issued in the Click event of cmdDelete.
В | Copy Code |
---|---|
* cmdDelete.Click #DEFINE MSGBOX_YES 6 #DEFINE C_MSGBOX1 36 #DEFINE C_DELETE_LOC "Are you sure you want to delete this record?" IF MESSAGEBOX(C_DELETE_LOC,C_MSGBOX1) = MSGBOX_YES DELETE IF !EOF() SKIP 1 ENDIF IF EOF() AND !BOF() SKIP -1 ENDIF THISFORM.Refresh ENDIF |
Extending the Data Entry Form
To create a more robust data entry form, one that makes it possible for a user to cancel changes or makes it possible for multiple users to access the same data, you need to use transactions and table or row buffering.