Checking for Null values.

Sigma248

Registered User.
Local time
Yesterday, 16:32
Joined
Oct 6, 2008
Messages
24
I am having a problem checking for null values when a form is opening.

I have multiple combo boxes on a form and depending on the value of each of these combo boxes associated text boxes display information.

i.e.

Depending on the value of cmbClient when the form opens associated clinet information is displayed in text boxes (Phone Number, email).

It works fine when cmbClient has a value but when it is null I get an error when trying to call the afterupdate event to get the information to display in the text boxes.

i.e. Current_Client_Code = Me.cmbClient.Value


Gives an error because Me.cmbClient.Value is Null.

How do I check for a Null value in this case?

I have tried:

If Me.cmbClient.Value = "" then

but when Me.cmbClinet is Null this does not work.

I have also tried:

If me.cmbClient.Value Is Null then

but this gives an Error Object Required.


What is the answer?
 
Though it might seem lazy to just point to a FAQ on another forum - if there were as comprehensive a piece on MSDN I'd point you to that instead ;-)
Brent's FAQ

(Quick answer... IsNull function - but read the above anyway!)
 
Thanks for that, the IsNull function works perfectly.

i.e. If not IsNull(cmbClient.Value) then

Call cmbClient_AfterUpdate

end if

If cmbClient.Value is Null no action is taken.
 

Users who are viewing this thread

Back
Top Bottom