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 1

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?

Thank you.
 
I don't know if you would like this solution, but have you considered allowing nulls in the table but effectively prohibiting them with the forms controls you are already implementing?

If this wouldn't be satisfactory, then how about making the forms not be a direct update to the to the database, but instead to a temporary table for data entry purposes only. Then when the record is complete, completion of the entry form would start the event to go ahead and update the actual table from the temporary table and delete the temporary table entry(ies).

Dale3
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top