I know I can look in two tables with d lookup
What I want is depending the case of what procedure I choose in a combo box, to look its time value in a employees table
timevalproc-The variable to assign the dlookup function in vba
tblEmployees
tblProcedure
[Haircut] or [Eyebrows] = [txt ID]
and the time for each of the procedures which is on tblEmployees:
I have this code as an example, this is what I tried, it's close, but I can't find where is the error
the second DLookup will take the place of the where condition of the first so unless it returns zero or null is probably going to be treated as true. it should work, but all it says is that there is a syntax error
What I want is depending the case of what procedure I choose in a combo box, to look its time value in a employees table
timevalproc-The variable to assign the dlookup function in vba
tblEmployees
tblProcedure
[Haircut] or [Eyebrows] = [txt ID]
and the time for each of the procedures which is on tblEmployees:
I have this code as an example, this is what I tried, it's close, but I can't find where is the error
Code:
timevalproc = DLookup("[Haircut Time]", "tblEmployee", "[Employee ID] = '" & [txtID] '" & Dlookup("[Procedure Name],"tblProcedure", "[Procedure Name]= '" & [cboProcedure] & "'") & "'")
Comment