Solved Customize the error message "You tried to assign the value Null to a variable that is not a Variant data type"

zelarra821

Registered User.
Local time
Today, 01:45
Joined
Jan 14, 2019
Messages
847
Hi.

I have a form with a dropdown. As it takes values from another table with which it is related, and saves the code in the source table of the form, if the user leaves the field empty, the message "You tried to assign the value Null to a variable that is not a Variant data type ". I have tried with all the possible events, but none of them allow me to customize that error (which would basically consist of replacing the error by putting a default value that I always add in the drop-down, type No data).

I don't know if you understand what I mean. How could I do it?
 
I would test for it in the before update event:


You can probably also catch it in the form's error event if you want.
 
Thank you very much for answering. It does not work. Look:
ScreenShot002.jpg


ScreenShot003.jpg


ScreenShot004.jpg
 
The link recommends the form's before update event, not the individual control's.
 
Ok, now it works perfectly. Thank you very much for the help.
 

Users who are viewing this thread

Back
Top Bottom