View
214
Download
0
Category
Tags:
Preview:
Citation preview
Systems Development Group Project
Programming Access Forms
Access Forms
Bound Forms
Unbound Forms
e.g. a Menu
Access Forms
Form Detail
Right click here to see form properties Some useful form
properties
Access Forms
Control Box Property to turn these on or off
Record Selectors property to turn these on or off
Min Max Property to turn these on or off
Plus various event properties – the LOAD event is especially important
Access Forms – Tool Box
Label Text Box
Command Button
List Box
Combo Box
Access Forms
Navigation buttons
Subform
Form Header
Form Footer
Text Box
Label
Access Forms
Note multiple associated records
Default View property set to ‘Continuous Forms’ NOT ‘Datasheet’
OwnerNo and PetNo have Visible property set to ‘No’
These labels are in the sub-form header
Data Entry property is set to ‘No’
Access Forms
Private Sub cmdExitPet_Click()
‘Not using Wizard‘closes this formDoCmd.Close‘opens main menu formDoCmd.OpenForm "frmVetMenu"
End Sub
Combo Box
List Box
Code in the On Click event of the Main Menu button (click on the property then on & then on ‘Code Builder’ to open up a code window.
…
Access Forms
Private Sub cmdMainMenu_Click()On Error GoTo Err_cmdMainMenu_Click
Dim stDocName As String Dim stLinkCriteria As String
stDocName = "frmVetMenu“
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdMainMenu_Click: Exit Sub
Err_cmdMainMenu_Click: MsgBox Err.Description Resume Exit_cmdMainMenu_Click End Sub
This the code for the other ‘Main Menu’ button, this time generated by the Wizard.
Would need to insert DoCmd.Closeform here.
Wizards can make things easier sometimes, but can also make code unnecessarily complicated
List and Combo Boxes
Important control settings
Can build a query for the row source
…
Recommended