Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button to Reset a Form 1

Status
Not open for further replies.

cimoli

Technical User
Jul 30, 2010
207
US
I used to have an Access button that would reset my form after a search.
I must have done something to make the button not work now.

I have 19,000 form records when I start. I hit a different button that gets me a particular TripID.
Then I get correctly 42 records. When done, I would like to hit my Reset button and get back
my 19,000 records.

I previously had an On Click of :

Private Sub cmdRESET_Click()
Me.FilterOn = False
End Sub

Tonight, I read other people's comments and internet places and added a Requery line above the end sub.
But still does nothing. Now I have :

Private Sub cmdRESET_Click()
Me.FilterOn = False
Me.Requery
End Sub

Any ideas? Thanks much.
 
What happens when you place a breakpoint in your code to assure it is running?

You could also make sure it is running by adding a line:

Code:
Private Sub cmdRESET_Click()
 MsgBox "cmdRESET_Click"
 Me.FilterOn = False
 Me.Requery
End Sub

Duane
Hook'D on Access
MS Access MVP
 
Hi Duane. Ran your test. I get the cmdReset_click message real fast. so that part seemed to work as you expected.

As a summary, I am on the form with 19,000 records. I next call up 1 reservation. After reviewing it, i want to hit the reset button and get back my 19,000 records for other kinds of lookups.

So maybe your test will tell us something? I've been avoiding what some sites say to do, which is to have EACH lookup field set yo " " in this Reset button thanks for the next tip.

 
Duane,
smooth as silk again. Thanks alot. Below is the final code for other people to share. I had to remember to get out
and come back in the first time. Nice job.


Private Sub cmdRESET_Click()
'2/17/2015 from Duane H.
Me.FilterOn = False
Me.RecordSource = "qryReservation"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top