clear a combo box

  • Thread starter Thread starter BobC
  • Start date Start date
B

BobC

I have a form (frmClaim) that is bound to a query (qryClaims).
I am using a ComboBox (cboClaim#) on a form (frmClaims)to search for
particular Claim# records to edit.
The Claim# field from the query is also displayed in a TextBox
(txtClaim#)on the same form (as verification that I found the correct
record).
If I use the ComboBox to locate a particular record and then use the
navigation buttons to move forward or backwards from that record, I end
up in a confusing situation where the TextBox displays the changed
record, however the ComboBox remains unchanged displaying the previously
searched for Claim#.
I am willing to use code, but do not know if I can force the ComboBox to
follow along with the new record ... or maybe there is a better approach?
 
BobC,
put some code in the On Current event of the form to clear the combo.
The On Current event fires every time you go to a new or different record.

The code to clear the combo is:

Me.NameOfCombo = Null

So we get
-----------------------
Private Sub Form_Current()
On Error Resume Next

Me.NameOfCombo = Null

End Sub
----------------------

Note: replace NameOfCombo with the name of your combo


Jeanette Cunningham -- Melbourne Victoria Australia
 
Back
Top