Link to home
Create AccountLog in
Avatar of MeowserM
MeowserM

asked on

syntax to reference a combobox field on a subform

Hello:

I have a form with a tab control on it.  In the tab control I have several subforms.  On the one subform I have a combobox field.  I am trying to write some vba code that says if the combobox field is null then display a message.  I have tried this several ways but I think I am not using the correct syntax to reference the combobox field.  I have a suspicion that I don't have the right subform name.  
Here is the code I have right now:
If IsNull(Forms!FrmAudit!AuditScheduleDetail.cboAuditElement) Then
MsgBox ("You must enter something in AuditElement field")
Else
End If

Thank you in advance

ASKER CERTIFIED SOLUTION
Avatar of VTKegan
VTKegan
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of MeowserM
MeowserM

ASKER

Thank you.  I was using the correct subform control name (even though I changed it a hundred times) but I must have removed the .Form. at some point.

Thank you!!
Thanks again