I have an unbound form which the user selects criteria for a report output.
If the user enters a 7 digit number in TXT_Parent (an unbound field), I want to be able to check if the first 4 digits match any of the records in a table (TBL_SelCon) which is used for a (hidden at the time) combo box (CBO_ConList) on the form.
I tried the following:
if left((TXT_Parent),4) <> [TBL_SelCon]![Contract_Code] Then
Msgbox "This is an invalid number" blah blah blah
Else
Proceed.....
End if
An error message saying the table cannot be found - because it's not open I suppose? Would anyone know how I can get this to work or am I asking the impossible??
Many thanks
NKA
The answer's always easy - if you know it! ;-)
If the user enters a 7 digit number in TXT_Parent (an unbound field), I want to be able to check if the first 4 digits match any of the records in a table (TBL_SelCon) which is used for a (hidden at the time) combo box (CBO_ConList) on the form.
I tried the following:
if left((TXT_Parent),4) <> [TBL_SelCon]![Contract_Code] Then
Msgbox "This is an invalid number" blah blah blah
Else
Proceed.....
End if
An error message saying the table cannot be found - because it's not open I suppose? Would anyone know how I can get this to work or am I asking the impossible??
Many thanks
NKA
The answer's always easy - if you know it! ;-)