Combo box requery

  • Thread starter Thread starter Kay
  • Start date Start date
K

Kay

I have a form that uses a combo box to provide drop lists
of selection opions. The first cbo field provides the
criteria for the 2nd cbo field. Question: When adding new
records, the combo box fields do not clear after moving to
a new record. How can I keep this from happening?
 
I assume that the combo boxes are unbound. You could set their values to
Null in the code that moves you to a new record; or, if you're using
navigation buttons, put this code in the form's OnCurrent event:

Private Sub Form_Current()
If Me.NewRecord = True Then
Me.cboBox1.Value = Null
Me.cboBox2.Value = Null
End If
End Sub

If you always want to clear the combo boxes when you move to a different
record, whether a new record or not, then just use this:

Private Sub Form_Current()
Me.cboBox1.Value = Null
Me.cboBox2.Value = Null
End Sub
 
Back
Top