DLookUp with two criteria

T

Tim

I have a table in my database called tbl_Users with field
names of "User_ID";"Monday";"Tuesday";"Wednesday" etc.
Each of the "Day" fields holds the number of hours each
individual works on that particular day. I want to write
a DLookUp query to bring back the number of hours
dependant on both the date entered and the User_ID.

The code below picks up the hours worked assuming the
date is a Monday, but how do I include the second
variable (which I have called HolDate)?

HolHours = DLookup("Monday", "tbl_Users", "User_ID = """
& Me!User_ID & """")
 
A

Allen Browne

HolHours = DLookup(Format(Date, "dddd"), "tblUsers, _
"User_ID = """ & Me.User_ID & """")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top