I have tried to search for a solution here but nothing seems to work
Im trying to validate a value in a text box on my form.
ive tried both of these:-
'If Nz(DLookup("[MyNumber]", "MyTable", "[MyNumber]=(Forms![MyForm]![MyFormNumber])")) Then
msgbox "good"
else
msgbox "bad"
end if
If IsNull(DLookup("[MyNumber]", "MyTable", "[MyNumber]=(Forms![MyForm]![MyFormNumber])")) Then
msgbox "good"
else
msgbox "bad"
end if
When i use Nz it tells me the number is in the table
whether it is or isnt.
When i use IsNull it does the exact opposite and tells me the number is not in the table .
does anyone know what im doing wrong?
"My God! It's full of stars...
Im trying to validate a value in a text box on my form.
ive tried both of these:-
'If Nz(DLookup("[MyNumber]", "MyTable", "[MyNumber]=(Forms![MyForm]![MyFormNumber])")) Then
msgbox "good"
else
msgbox "bad"
end if
If IsNull(DLookup("[MyNumber]", "MyTable", "[MyNumber]=(Forms![MyForm]![MyFormNumber])")) Then
msgbox "good"
else
msgbox "bad"
end if
When i use Nz it tells me the number is in the table
whether it is or isnt.
When i use IsNull it does the exact opposite and tells me the number is not in the table .
does anyone know what im doing wrong?
"My God! It's full of stars...