Share via

Button to Clear/Reset Two Combo Boxes?

Anonymous
2014-09-05T12:10:12+00:00

I have two combo boxes used to select filter criteria for a form, cboSelectPatient and cobSelectPhysician.

They are working wonderfully.

However, I'm now looking for a quick, one-button way to reset them to their initial values (how they are when the form opens) - with no selections enabled.

I've tried using the following, but it's not working the way I truly want:

Private Sub Command42_Click()

Me.cboSelectTester.Value = ""

Me.cboSelectPatient.Value = ""

Me.Requery

End Sub

Note: The values in the combo boxes ARE test, not numeric.

What do I need to do to the on_click code to get this button working the "right" way?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2014-09-05T13:12:43+00:00

    You are correct on both counts. The code worked great - don't know how I got so turned around on it.

    And, the button name -- definitely not good, but also not permanent. I was just testing and have since renamed it.

    Was this answer helpful?

    0 comments No comments
  2. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2014-09-05T13:04:35+00:00

    That's not a great name for a button.

    The code would be:

    Me.cboSelectTester = Null

    Me.cboSelectPatient = Null

    Was this answer helpful?

    0 comments No comments