I really have no idea why this doesn't work, but I am trying to get the following to work:
If Me.Text1 = DLookup("Field1", "Test1_Table", "Test1_Table.Field1= _
& Me.Text1") Then
MsgBox "It works"
Else
End If
The above code is a test code for a larger project that I am working on, so the table and field names are just for testing. Also, Field1 is a numberic field. Basically, when I enter 1 within Text1, I would like the DLookup feature to find 1 within Test1_Table.Field1 and give me a message stating that it works. I am able to get this to work with string values such as:
If Me.Text1 = DLookup("Field1", "Test1_Table", "Test1_Table.Field1='" _
& Me.Text1 & "'")Then
Likewise this works, when 1 is entered in the Text1:
If 1 = DLookup("Field1", "Test1_Table", "Test1_Table.Field1= _
& Me.Text1") Then
However, I've tried:
If Me.Text1 = DLookup("Field1", "Test1_Table", "Test1_Table.Field1= _
& Forms!TestSearch_Form!Text0)Then
and
If Me.Text1 = DLookup("Field1", "Test1_Table", "Test1_Table.Field1= _
& Forms!TestSearch_Form!Text0)Then
etc...
I've tried many different combinations and it seems as though I cannot get the two to equal, when dealing with numeric values. Does anyone know what I am missing or have any ideas?
Thank you,
Damion