Dlookup

D

David W

I can use dlookup to a search for 1 item in a record, but how would you
compare a second item to the same record?
I used
If DLookup("date1", "repairlog", "date1 = #" & Me!dateset1 & "#") Then
to find the record, but I need to compare [employee] in ths same table to
see if the record exist.

Is that possible?
 
F

fredg

I can use dlookup to a search for 1 item in a record, but how would you
compare a second item to the same record?
I used
If DLookup("date1", "repairlog", "date1 = #" & Me!dateset1 & "#") Then
to find the record, but I need to compare [employee] in ths same table to
see if the record exist.

Is that possible?

If I understand you correctly ...

DLookup("date1", "repairlog", "date1 = #" & Me!dateset1 & "# AND
[EmployeeID] = " & Me![EmployeeID])

wher the [EmployeeID] is a Number datatype.
 
D

David W

I got this a few minutes ago
If DLookup("date1", "repairlog", "date1 = #" & Me!dateset1 & "#" _
& " And employee = '" & Forms!time1.Combo217 & "'") Then

fredg said:
I can use dlookup to a search for 1 item in a record, but how would you
compare a second item to the same record?
I used
If DLookup("date1", "repairlog", "date1 = #" & Me!dateset1 & "#") Then
to find the record, but I need to compare [employee] in ths same table to
see if the record exist.

Is that possible?

If I understand you correctly ...

DLookup("date1", "repairlog", "date1 = #" & Me!dateset1 & "# AND
[EmployeeID] = " & Me![EmployeeID])

wher the [EmployeeID] is a Number datatype.
 
R

Ron Kunce

If DLookup("date1", "repairlog", "date1 = #" & Me!dateset1 & "#") Then
strEmp = DLookup("employee", "repairlog", "date1 = #" & Me!dateset1 &
"#")
End If

Of course you would be better off using a query as DLookup's can be quirky.

I can use dlookup to a search for 1 item in a record, but how would you
compare a second item to the same record?
I used
If DLookup("date1", "repairlog", "date1 = #" & Me!dateset1 & "#") Then
to find the record, but I need to compare [employee] in ths same table to
see if the record exist.

Is that possible?
 

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