Posted on 2011-03-24
I've declared a global variable:
Public strBarCode As String
On opening a certain form I want it to check to see if that string is populated.
Private Sub Form_Open(Cancel As Integer)
If strBarCode Is Not Null Then
Me![txtBarCode].Value = strBarCode
But on the bold line above I'm getting a Type Mismatch Compile Error.
The global variable is working correctly because if I check and hover over strBarCode it returns the value I'm expecting 2222. I made it a string as some Bar Codes sometimes have letters in.
What have I done wrong? Help appreciated and thanks in advance.