VXFORM2 Aircraft Types Form3 Label1 Type Code Tms Rmn TypeCode Label2 Description Tms Rmn TypeDesc TypeSave &Save TypeCancel &Cancel TypeAdd TypeDelete &Delete TypeNext &Next TypePrev &Previous TypeBrowse &Browse TypeExit E&xit Label3 Status Tms Rmn TypeStatus Form_Load vxSelectDbfa AirtypesDbf Form2Active TypeReturn BROWSE_ADD TypeDataClear TypeStatusm TypeSave EnabledJ TypeCancel: TypeAddy FALSEU TypeDelete BROWSE_EDIT TypeDataLoad vxRecNo TypeCode TypeDesc vxUnlockd CursorWait vxfield CursorArrow TypeCode_KeyPress KeyAsciis TypeSave_Click SeekKey EmptyString vxSeek vxAppendBlank vxReplString vxWrite: TypeAdd_Click TypeBrowse_Click VXFORM2 Visible BROWSE_USER3 BrowseTypes TypeCancel_Click TypeDelete_Click& vxLockRecord vxDeleteRec TypeExit_Click? TypeNext_ClickZ vxSkip TypeNext TypePrev TypeBrowseQ vxEof vxDeleted vxBottomx TypePrev_Click vxBofc vxTop TypeCode_GotFocus vxCtlLength4 TypeDesc_GotFocus Form_Unload Cancel vxClose vxWindowDereg VXFORM1 OpenTypesW OpenCust PackFiles TestCreate$ TestCopy TestDataCopy TypeDesc_KeyPresst Form_Paintf vxFormFrame vxCtlStyle VX_RECESS VX_RAISE BROWSE_DELETE Form_Load On form load analyze results of browse return ALWAYS select the database as the first statement in the FORM_LOAD procedure. This registers thee select area with the vxBase System Task manager. You MUST also select the database as the firstr statement in the FORM_PAINT procedure. This registers the select area with the vxBase Taskr Window manager. If you do these two things, vxBase will ensure smooth multiwindow operation in the task, and also smooth multitasking operation if you wish to run more than one Visual Basic vxBase program at the same time (or multiple instances of the same Visual Basic vxBase program.e Record addition request" if user pressed ENTER then file is positioned at current record and the record number isn returned in TypeReturn. In this case we assume he wants to edit that record. call general proc to load controls- Edit record TypeDataClear Clear Form in preparation for add or after successful delete ensure database unlocked- TypeDataLoad Load data from current record ensure data entry enabled category catname" unlock for multiusers In a multiuser or multitasking environment, the file- should be unlocked after you have extracted the data- you are interested in. See the "MultiTasking andd MultiUser Considerations" section in the manual for a full discussion.a TypeCode_KeyPress Convert type code to uppercase as it is being entered also convert enter key to tab {Tab}" TypeSave_Click Validate data when save button is pressed verify something in the field Field cannot be empty" note that if this was a real application we wouldn't- allow a change to the type code if the record was being edited unless we were prepared to cross reference all of the other files affected by a change. We alsoe wouldn't allow the onscreen edit in the browse. This is just a sample application.n verify unique key if adding Duplicate Key on Add Data passed. Put it away notice the brackets around the control property below which gets at the data contained thereiny category catname" Update status box Record " appended" Record " saved Update Button Status ensure database unlockedd TypeAdd_Click clear form for addition of new record Record Addition Request" ensure data entry enabled reset the buttons TypeBrowse_Click current form is unloaded because if needed again the form_load proc must be invoked to reset the control datad so we don't close files when we unload the form TypeCancel_Click Clear form data and reset button status Operation cancelled" we must disable data entry because the user could enter a new record in the blank boxes and then press the Add button. The TypeAdd_Click routine clears the form boxes again prior tol accepting input so the user's work would be lost and he would be mad.h TypeDelete_Click get user confirmation of delete Confirm Delete Deleted Delete failed" Delete cancelled TypeExit_Click unloading the form performs cleanup for us TypeNext_Click skip forward one record if skip error, only allow exit- Error on Skip Next. Try Reindex. test for end of file End of File! Skipped to record TypePrev_Click skip back one record if skip error, only allow exit Error on Skip Previous. Try Reindex. test for beginning of filer Beginning of File! Skipped to record TypeCode_GotFocus set up text length limit category# TypeDesc_GotFocus set up text length limit catname"# Form_Unload close types file and reset table and reenable menu items if we're NOT being unloaded by the Browse button IT IS IMPORTANT THAT YOU DEREGISTER THE WINDOW THAT THE FILE SELECT AREA WAS ATTACHED TO IN THE FORM_UNLOAD PROC. IF YOU DON'T, YOU ARE LIABLE TO RUN OUT OFO TASK-WINDOW ENTRIES (96 in all are allowed) If BrowseTypes is invoked by clicking the Browse- button on the edit form, we don't want to close the files. If we get here for any other reasone (like picking the exit button on the form oro using the System menu to close the window) then we close the files, release the table memory, and reshow the menu form so the user can pick something else. TypeDesc_KeyPress convert ENTER to tab- {Tab}" Form_Paint ALWAYS select the database as the first statement in the FORM_LOAD procedure. This registers thee select area with the vxBase System Task manager. You MUST also select the database as the firstr statement in the FORM_PAINT procedure. This registers the select area with the vxBase Taskr Window manager. If you do these two things, vxBase will ensure smooth multiwindow operation in the task, and also smooth multitasking operation if you wish to run more than one Visual Basic vxBase program at the same time (or multiple instances of the same Visual Basic vxBase program.e paint three dimensional controls- if delete request from browse, do it now- because we must let enhanced controls paint before asking for delete confirmation