clear combo data on add- [comboboxname].ItemData(n) not working

G

Guest

I am trying to clear the previous combo box data data on a form when adding -
this is the statement I am using in the form's default value for the field
[comboboxname].ItemData(0) - The first record in each combo box is a blank.

Why is this not working?
 
G

Guest

I'm assuming that the form is a data bound form and the combo box is also
data bound?
 
G

Guest

Try adding this code on the current event.

Private Sub Form_Current()
If Me.NewRecord Then ' a new record
Me.Combo0.DefaultValue = Me.Combo0.ItemData(0)
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top