Null not allowed, user friendly msgbox

Pauldohert

Something in here
Local time
Today, 15:40
Joined
Apr 6, 2004
Messages
2,097
I have a table field where Null is not allowed, how do I use a user freindly message to tell the user to add data to this field. When a user tries to leave the field Null (ie by tabbing out), they get a message, "tried to assign NUl value to vaiarble which is not variant datatype.

What I want to appear is more like "Please enter a name" or some other custom message.

Any ideas - I have tried before anfd aftyer update events and vaidation rule on the form field of Not Null, but the underlying message always appears first.

Paul
 
In the before update event did you have the code cancel the update if the field value is null? It sounds like you have a required field in your table that is being hit despite your before update event.

Where do you have the field listed as required? In the form, the query, or the table, and how is your form related to the table (i.e.: directly or through a query)?
 
The field in the table is set not to accept Null, my form is based upon a query.

The before update code does not even run - the default message seems to run first!
 
can you post your code for the before update event? The other place to try is the On Exit event.
 

Users who are viewing this thread

Back
Top Bottom