Is Is Null for sub-form

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

I have a main form with a combo on it (NameA) is the control source, NameB
is the name of it
On the sub-form if a user tries to enter anything without the NameA control
on the main having anything in it
Then I need to not allow this.
Sub-form is named Time and Hours
Control on sub-form to trigger code is named Employee Time with it's control
source set to EmployeeID
 
Use the on-enter event of the SUB FORM CONTROL.


You code can look like:

Private Sub contactChild_Subform1_Enter()

if IsNull(me.NameA) = true then
msgbox "You must enter a value for NameA before entering values
here",vbExclamation
me.nameA.SetFocus
endif

End Sub
 
Back
Top