User nulling numeric field using space bar

marnieg

Registered User.
Local time
Yesterday, 19:46
Joined
Jul 21, 2009
Messages
70
I have a numeric field on a form and the database definition is that the default is 0. When the user is on the form and hits the space bar to clear the field it sets the database value to null instead of 0, which then causes issues when I try to do calculations on other fields using this field. Is there a property that can be set to say if they space it out set it to 0.

Thanks for any assistance in this manner.
 
in the control's beforeupdate event, test if null, and either set back to 0, or prevent the user exiting.

thinking about it, you may not be able to change the vlaue in the beforeupdate - but you could do this in the afterupdate event
 
Yes decided to use the NZ function on my updates that use this field in the calculations.
 
in the control's beforeupdate event, test if null, and either set back to 0, or prevent the user exiting.

thinking about it, you may not be able to change the vlaue in the beforeupdate - but you could do this in the afterupdate event
You can change values in the Before Update event.
 
Change the table to make the column required. Jet/ACE will not allow it to be null. You can also check the field for null but you MUST do it in the FORM's BeforeUpdate event since there is no guarentee that the control's BeforeUpdate event will be fired given that the field is null.
 

Users who are viewing this thread

Back
Top Bottom