Hi all,
Im trying to check for data in a subform and if its empty then allow the user to quit - can anyone shed some light on how to do this please? (Not too sure if its a vba question or not, although I will be trying to use VBA code)
Hi all,
Im trying to check for data in a subform and if its empty then allow the user to quit - can anyone shed some light on how to do this please? (Not too sure if its a vba question or not, although I will be trying to use VBA code)
Managed to work it out myself by using the following code:
Was having a hard time understanding how access refernces subforms, and didnt realise you have to go from the top down to get to a control.Code:Private Sub Exit_Database_btn_Click() If Forms![TimesheetForm]![TimesheetTableSubform].Form![SubActivity] = "" Or IsNull(Forms![TimesheetForm]![TimesheetTableSubform].Form![SubActivity]) Then DoCmd.Quit acQuitSaveNone Else MsgBox "Please submit your timesheet using the submit button"