Reset Switchboard search control

  • Thread starter Thread starter Pamela
  • Start date Start date
P

Pamela

I have an unbound text box on my switchboard into which users put criteria
which is then used to find the corresponding records. When the OnClick event
of the command button fires, I want the text box to reset itself - deleting
the previously entered value and making the field empty and ready for new
input which again can be searched. I've tried using Me.Text2.Requery and
Me.Text2.Undo but neither of these seem to work. I've even Me.Text2 = " "
and while it does make the field blank, when the user then inputs data to
search again, the system doesn't find a match. Thanks so much for any help!

Pamela
 
I have an unbound text box on my switchboard into which users put criteria
which is then used to find the corresponding records. When the OnClick event
of the command button fires, I want the text box to reset itself - deleting
the previously entered value and making the field empty and ready for new
input which again can be searched. I've tried using Me.Text2.Requery and
Me.Text2.Undo but neither of these seem to work. I've even Me.Text2 = " "
and while it does make the field blank, when the user then inputs data to
search again, the system doesn't find a match. Thanks so much for any help!

Pamela

Me.Text2 = Null

should work, if it's applied *after* the search has been run; obviously if you
apply it too soon you'll simply erase the criterion entered by the user.

Perhaps you could post your actual code, including the SQL view of the query.
 
I decided to code the Switchboard to close and then reopen which resets the
unbound text box. Thanks!
 
I decided to code the Switchboard to close and then reopen which resets the
unbound text box. Thanks!

Well, you can crack nuts with a hydraulic ram too... but a nutcracker is more
appropriate.

Me.textbox = Null

will work fine.
 
Back
Top