Quick Null value ?

RpbertS

Registered User.
Local time
Today, 21:46
Joined
Feb 14, 2000
Messages
93
Hi this is my first post.
Im almost done my first database but I have one problem left Null Values I have a combo box and the user would make a selection and say they didnt want to choose anything there they would delete it and would get a Null Value error when they try to exit. I've tried using queries but to no avail im stuck. any help to get around this error would be appreciated

thanks
Rpb
 
In the table, go to the properties of the field in design view. There is a property called "Allow Zero Length". Set this to no and let me know if that works.
 
you've got lots of options and it depends on how complicated you want to get! I'd set the vaildation rule of the combo box to Is Not Null if you don't want Null values.
OR go into the On Exit or After Update event of your combo box and drop in something like -
let me!mycomboboxname.value=nz(mycomboboxname.value,0)

Sorry if this bit is patronizing but I still can't look at my first db without cringing and thinking "I can't believe I did that"

Nz is a function that will change the value of your box, if it is null, to the value that comes after the comma. Instead of the 0 above you could use anything, as long as it fits the data type of your table field. The above will take Null values and change them to a 0. To get into where this needs to be go into the properties of your box, then into the Events tab and click onto the line of On Exit or After Update. Three dots will appear in a box on the left of that line (...), click onto them and stick in the code as above - substituting the mycomboboxname for whatever it's really called,

HTH, ignore me if it doesn't

Drew


[This message has been edited by KDg (edited 02-14-2000).]
 

Users who are viewing this thread

Back
Top Bottom