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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation rule 1

Status
Not open for further replies.

ds2728

Programmer
Jul 18, 2001
50
US
I have a few combo boxes on some forms that I wish to validate so users can not type in some bogus data.

I setup the validation rule property on the combo box to =dlookup function which works great. My problem is I really need to allow for blank or null inputs.

Once you enter a valid value and move on to the next combo box everything is great. Until you decide you would like to change your mind and remove data you previously entered into one of the combo boxes. After you remove the data and make it blank, I can't move off the field due to the validation rule.

I have tried to enter a blank record in my combo referance table, the same one that the dlookup function uses and still no work.

Can anyone please help.....

Thanks,

dave
 
dave,
You could add OR Is Null to the validation rule.
--Jim
 
I have tried this and have not been able to make it work, here is my validation rule:

=DLookUp("[design]","lkup_pn_design","[design] = '" & [Forms]![edit_mpl_record]![sa_design] & "' or isnull(" & [Forms]![edit_mpl_record]![sa_design] & ")")

This rule works until I add the following to the rule:
or isnull(" & [Forms]![edit_mpl_record]![sa_design] & ")"

With the above rule I do not get any error message or my validation text. Control will not move from that field at all no matter what I enter into the field. I have also tried different variations of this rule.

Any help would be greatly appreciated.

Thanks,

dave


 
Dave,
What I meant by adding the Is Null was simply:
=DLookUp("[design]","lkup_pn_design","[design] = '" &
[Forms]![edit_mpl_record]![sa_design] & "' or Is Null
Let me know if that does it.
--Jim
 
Jim,

Thanks.... it worked My final command is:

=DLookUp("[design]","lkup_pn_design","[design] = '" &
[Forms]![edit_mpl_record]![sa_design] & "'") or Is Null

I was not understanding that the " or is null" went outside the parens.

Thanks again....

dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top