Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

dlookup function only check first record in a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave S - 06 Mar 2007 17:44 GMT
Help.  I have a labor tracking database that I'm ready to roll out today and
I have one last error to correct.

I have a field for operators to enter their employee ID into.  This will be
done with a bar code reader that also sends CR/LF to move to the next field.  
I want to use a dlookup to make sure that the user exists in an "Associates"
table.  The expression that I have built into the validation rule for this
control is:

=DLookUp("[Employee_ID]","Associates","[Employee_ID] = " &
[Forms]![Time_Data_Input_Form]![Employee_ID] Is Not Null)

This works fine but it will only check validity of the first record in the
database (whatever that is).  It will NOT check any of the other records to
see if the employee ID entered is in the table.

What am I doing wrong?  I need it to check and see if the employee ID
entered is a valid user in the database.

Thanks,
Dave
Douglas J. Steele - 06 Mar 2007 18:02 GMT
That's not a valid WHERE clause (the "Is Not Null" at the end is wrong,
since you're already comparing Employee_ID to the form control)

=DLookUp("[Employee_ID]","Associates","[Employee_ID] = " &
[Forms]![Time_Data_Input_Form]![Employee_ID])

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Help.  I have a labor tracking database that I'm ready to roll out today
> and
[quoted text clipped - 22 lines]
> Thanks,
> Dave
Dave S - 06 Mar 2007 19:24 GMT
Thanks a lot, that worked just fine!!

Dave

> That's not a valid WHERE clause (the "Is Not Null" at the end is wrong,
> since you're already comparing Employee_ID to the form control)
[quoted text clipped - 28 lines]
> > Thanks,
> > Dave
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.