simple question about preforming a search

  • Thread starter Thread starter jjsaw5 via AccessMonster.com
  • Start date Start date
J

jjsaw5 via AccessMonster.com

Hello,

I have a form that is used for searching my database. In the header of the
form i have a text box where the user inputs the search criteria and then
presses a "Search" button to execute it.

What i would like to do is after the search button is clicked is there a way
that i can have the text box cleared of the information that was just
searched for?


Here is the code I'm using to preform my search



Private Sub Command35_Click()
If IsNull(cmbLock) = False Then
Me.Recordset.FindFirst "[SR Num]=" & cmbLock
End If
End Sub
 
Try

Private Sub Command35_Click()
If IsNull(cmbLock) = False Then
Me.Recordset.FindFirst "[SR Num]=" & Me!cmbLock
Me!cmbLock = Null
End If
End Sub
 
It shouldn't.

Try

Private Sub Command35_Click()
If IsNull(cmbLock) = False Then
Me.Recordset.FindFirst "[SR Num]=" & Me!cmbLock
Me!cmbLock = Null
DoEvents
End If
End Sub
 
Its still doing the same thing you have to click it twice for it to clear the
box
 
are you sure you have your controls event set correctly? there are two click
event options. one is "on click" the other one is "on double click".
 
Yes, i have it on the "on click" event. It exectues the search fine but it
does not clear the text box. The data stays in the box until you press the
"search" button again.
 
Back
Top