Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referring to a Main form control

Status
Not open for further replies.

CharlieT302

Instructor
Mar 17, 2005
406
US
Hey folks,

This should be easy. I have a main form/sub form. On the subform I have a drop down box that checks to see if a field on the main form is empty. If so, a message appears.

I have this on the "On Change" event of the drop down.

Here is the code:
If IsNull(Forms![FRM Referral].[County_Code]) Then GoTo county_Mess Else GoTo check_Service


It is not working and the message does not display. I believe the syntax is incorrect. Any suggestions?
 
Hi!

Any chance that it contains an empty string instead of null?

If so try:

If Nz(Forms![FRM Referral].[County_Code], "") = "" Then GoTo county_Mess Else GoTo check_Service

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Check for null, blank or zerolength:
If Trim(Forms!FRM Referral!County_Code & "") = "" Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks folks,

There was a spacebar entry in the field. That's why the code didn't work. I actually used a different formula to get around it:

If Forms![FRM Referral].[County_Code] <"a" then...

Its a text field and this approach worked in the past. Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top