empty field to variable

J

Jean-Paul

Hi,
in my code I have now:
contact = [Forms]![verslagen].[Sub_Bedrijsgegevens].[Form].[Contactpersoon]

Of course I first wrote dim contact as string.

Now:
[Forms]![verslagen].[Sub_Bedrijsgegevens].[Form].[Contactpersoon]
is empty, so I get an errormessage when the code reaches this line
saying something like:
illegal use of Null

How to avoid this and let the code continue even if it meets a null-field

Thanks
 
B

Beetle

Try;

contact =
Nz([Forms]![verslagen].[Sub_Bedrijsgegevens].[Form].[Contactpersoon],"")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top