Hope someone can help with this very strange but seriously annoying problem.
I have a form with an unbound text box(TxtPONo) that has a number entered into it and if it matches a number in my table(TblTransactions) then it should open a form(FrmGR). Seems simple enough and here is the code i am using:
If Me.TxtPONo = DLookup("DocumentNo", "TblTransactions", "DocumentNo = " & Me.TxtPONo) Then
DoCmd.OpenForm "FrmGR"
Else
MsgBox "Not working", vbOKOnly
End If
The code in red is just there for testing purposes. This code is in the afterupdate event of the text box.
What makes this problem even stranger is i have similar code just with different table and that is working perfectly. I just cant seem to figure out why it wont open the form when i enter a number that i know is in the table.
Any help would be much appreciated.
Thanks
Gareth
I have a form with an unbound text box(TxtPONo) that has a number entered into it and if it matches a number in my table(TblTransactions) then it should open a form(FrmGR). Seems simple enough and here is the code i am using:
If Me.TxtPONo = DLookup("DocumentNo", "TblTransactions", "DocumentNo = " & Me.TxtPONo) Then
DoCmd.OpenForm "FrmGR"
Else
MsgBox "Not working", vbOKOnly
End If
The code in red is just there for testing purposes. This code is in the afterupdate event of the text box.
What makes this problem even stranger is i have similar code just with different table and that is working perfectly. I just cant seem to figure out why it wont open the form when i enter a number that i know is in the table.
Any help would be much appreciated.
Thanks
Gareth