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

Dlookup record validation

Status
Not open for further replies.

DyerQ

Technical User
Jun 19, 2003
7
US
Hello,

I am trying to use the Dlookup function to validate
data entered into a table.

I would like to check an alternate table to make
sure the value exists in that table using the validation
rule property of the text box on the data entry form.

If the value does not exist in the alternate table
I want to get an error message. See syntax below:


=DLookUp("TRNCD","as procedure","TRNCD="& Forms![Document Issue Table Maintenance]![Procedure] ")

Where:
TRNCD is the field I would like to check for
a match.

as procedure is the table that I need to check that
contains TRNCD.


[Document Issue Table Maintenance] is the form the text
box [Procedure] is tied to.

Can you help with the syntax. As I understand it the
function should return the value in my text box
if found but I'm not sure what to put at the end or
if the syntax has an error.
 
That should work!

=DLookUp("[TRNCD]","as procedure","[TRNCD] = " & Forms![Document Issue Table Maintenance]![Procedure])
 
Shot in the dark, but how about putting the words "as procedure" in brackets: "[as procedure]". May not like the embedded blank otherwise.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top