Error Code 3162

Design by Sue

Registered User.
Local time
Today, 12:55
Joined
Jul 16, 2010
Messages
809
I need to reset a combo box to display as blank from VBA If I use Me.[EmployeeNumber] = Null I get the error code 3162. What is the correct code to reset a combo box?

Thanks
 
I think I found the answer it should be set to "" not Null
I would still use Null, but I'm not sure why it's not working for you. What is the error message for error 3162?
 
Error 3162 is "tried to assign Null to something that isn't a Variant" or words to that effect.

If the control is bound to a number field, that would do it. Bound numerics can only be null when the record itself is null (perhaps due to an outer JOIN that didn't find a match.
 
Error 3162 is "tried to assign Null to something that isn't a Variant" (or words to that effect.

If the control is bound to a number field, that would do it. Bound numerics can only be null when the record itself is null (perhaps due to an outer JOIN that didn't find a match.)
You tried to assign a Null value to a variable that is not a Variant data type.
 
You tried to assign a Null value to a variable that is not a Variant data type.
I usually see that error message in code. Did you happen to declare a variable as String and then tried to assign Null to it? As far as I know, a field is not a variable and neither is a Textbox control on a form.
 
Is your combo box not bound? That might be an integer rather than an object.
 

Users who are viewing this thread

Back
Top Bottom