I'm working on a timeclock system in a vba access database. I'm trying to get the system setup so when you hit the clock in button it checks to see if you have clocked in at some point that day. if you have it displays a message telling you you have already clocked in today. I am trying to look up two values. it first checks for the employee id and the second looks up the date today.
I'm using a composite key with the employee ID and the date as the primaries. I was working on this for several hours yesterday and just cannot find my mistake in this dlookup.
everything is setup as strings because of a screw up i made earlier in the database and did not want to have to go back through it. The EmpID is setup as string. The Date is currently as string but if it needs to be changed I'm sure that wouldn't cause too much of an issue.
Anyway I'm getting a null value off of this dlookup so i'm sure my syntax is wrong on some level. Any help evaluating this dlookup would help.
Actual names of variables are as follows
strEmpID as string
Datetoday as string
lastly in this last attempt i was trying to take the direct input from the combo box on the form.
any help is incredibly appreciated thank you
Dave
I'm using a composite key with the employee ID and the date as the primaries. I was working on this for several hours yesterday and just cannot find my mistake in this dlookup.
everything is setup as strings because of a screw up i made earlier in the database and did not want to have to go back through it. The EmpID is setup as string. The Date is currently as string but if it needs to be changed I'm sure that wouldn't cause too much of an issue.
Anyway I'm getting a null value off of this dlookup so i'm sure my syntax is wrong on some level. Any help evaluating this dlookup would help.
Actual names of variables are as follows
strEmpID as string
Datetoday as string
lastly in this last attempt i was trying to take the direct input from the combo box on the form.
Code:
strNameAndDate = DLookup("[EmpID]", "TblTimeSlip", "[EmpID] = " & Forms![ClockingService]![CboEmpID] And "[TblTimeSlip]![DateWorked] =" & strDateToday)
Dave
Comment