Can someone please help me with this...I am spending too much time on this simple thing:
I have a DLookup Function that I need to make work using values from text boxes on my form instead of the actual values.
This works:
x = DLookup("[Index]", "[tblMain]", "[LastDayWorked] = #12/03/2004# AND [SIN] = '123456789'")
Now, I need to replace the values #12/03/2004# with Me.LastDayWorked and 123456789 with Me.SIN
Here is how I did it, but I am getting a type mismatch error...it must have something to do with the quotes or brackets???:
x = DLookup("[Index]", "[tblMain]", "[LastDayWorked] = " & Me.LastDayWorked & "AND [SIN] = " & Me.sin)
THANKS IN ADVANCE FOR THE HELP!
I have a DLookup Function that I need to make work using values from text boxes on my form instead of the actual values.
This works:
x = DLookup("[Index]", "[tblMain]", "[LastDayWorked] = #12/03/2004# AND [SIN] = '123456789'")
Now, I need to replace the values #12/03/2004# with Me.LastDayWorked and 123456789 with Me.SIN
Here is how I did it, but I am getting a type mismatch error...it must have something to do with the quotes or brackets???:
x = DLookup("[Index]", "[tblMain]", "[LastDayWorked] = " & Me.LastDayWorked & "AND [SIN] = " & Me.sin)
THANKS IN ADVANCE FOR THE HELP!