Question : combo box won't hold default value

i have a combo box on a form and i set the default value for the combo box and it seems to work when i start a new record

but when i go to a new field and try to add data the default value dissappears

Answer : combo box won't hold default value

Not sure why that would be, but as a work around ... set your default values in the Form BeforeInsert event, like so:

Private Sub Form_BeforeInsert(Cancel As Integer)
    Me.YourComboBoxName = YourDefaultValue ' string, date, number, etc
    ' more default values
End Sub

The BeforeInsert event will trigger as soon as you enter a value in any Bound control in a new record.

Also, this has the advantage of property sheet default values 'showing' as soon as you get to the new record position ... which makes it look like there is already a record there.  This is much cleaner from a UI standpoint.

Also ... if you do this, remove the default value for the combo box from the property sheet.

mx
Random Solutions  
 
programming4us programming4us