Reset Switchboard search control

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
 
J

John W. Vinson

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.
 
P

Pamela

I decided to code the Switchboard to close and then reopen which resets the
unbound text box. Thanks!
 
J

John W. Vinson

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.
 

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