Is Is Null for sub-form

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
 
A

Albert D. Kallal

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top