Click to See Complete Forum and Search --> : Invalid use of Null


aussiecyclone
March 31st, 2001, 10:30 PM
Hi,

I want to populate a forms text boxes from an Access DB, if any of the fields are empty I get Invalid use of Null error, how can I get over this? what I have tried is:

If Address.Fields("Suburb") = Null Then txtSurburb.Text = ""

Any help appreciated.

Regards,

Alan.

GungaDin
March 31st, 2001, 11:25 PM
Try this:



txtSuburb.text = Address.Fields("Suburb") & vbNullString





That way you won't need the if statement.

Hope this helps,

Nathan Liebke

cksiow
April 1st, 2001, 01:37 AM
I think you can set that field to allow NULL value during you define the table provided it's not a key.

cksiow
http://vblib.virtualave.net - share our codes

SAKYA
April 1st, 2001, 05:16 AM
there is a function to check if the field is null.
try this:-
if not isnull(fieldname) then
code
end if