clear a combo box

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?
 
J

Jeanette Cunningham

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
 

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