Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with Null values

Status
Not open for further replies.

TanyaSealey

Programmer
Jul 17, 2002
10
0
0
GB
I'm currently building a SQL Server database, with an Access 2000 front-end. I've set all numeric fields to not Allow Nulls, and I've set default values to 0. I want to control null values in the Access forms, so that when the user enters a null value a before- or afterupdate event procedure converts it to 0. However before any event runs (afterupdate, beforeupdate, change etc) I get the following error message: You tried to assign the Null value to a variable that is not a Variant data type. (Error 3162). Does anyone know how I prevent this message from appearing?
 
Tanya.

Even thought the message appears, is your record being added anyway. Your message implies that it is, in which case you could add some error trapping code to ignore the error.

If however the record is not being added because of the varient error, try determining the data-type of the field you are trying to pass a "0" into. As far removed as it possibly is, chances are you are inserting a "0" into a field that does not permit becasue of the data-type.

birklea birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top