Combo defaults to -1

jason_nevin

Registered User.
Local time
Today, 19:57
Joined
Nov 22, 2002
Messages
46
I have a combobox which is taking its values from a table. For some reason, however, it defaults to -1. The default value property is empty. I even tried cutting and pasting from the combo above which is almost exactly the same but all to no avail. I can't figure why. Help!
 
Defaults can come from the table definition or from the form or you might have some code in the module behind the form that is setting the value to -1.
 
Thanks for your reply Pat

I can't see that it is either. The table field has no default value either. I also have a date field on the form which seems to be doing similar (its defaulting to 30/12/1899).
 
The date field is easy to explain. Dec 30, 1899 is the 0 value. Dates are stored as double precision numbers with the integers representing the number of days since Dec 30, 1899 and the decimal portion represents the time of day. The bottom line is - NEVER use 0 as the default value for a date field, leave the default empty which sets the default to null.

-1 is also the value for true. Does that help?
 
It sounds like I've got a similar problem with both fields then. The default value property is not set in either the table or the form. I'm confused! My tables are linked but can't see that this makes any difference.
 
You may have to look at the tables in their database rather than through the linked view.
 
All solved. In my code I'd missed out the .Locked property and was setting these values to False. Sorry to waste your time!
 

Users who are viewing this thread

Back
Top Bottom