A problem with on key press event

snoopy22

Registered User.
Local time
Today, 00:10
Joined
Oct 1, 2004
Messages
45
Hi, it's me again :D

I've got:
1. txtsSarch(textbox)
2. cmdSearch(button)
3.subTrans(a subform within the form)

every time i push the button my subform present the search result according
to the search filter(txtSearch) and it works fine.
here is the code:

Private Sub cmdSearch_Click()
Me.subTrans.Form.RecordSource = "select * from Transaction where Name like " & """" & "*" & _
Me.txtSearch & "*" & """"
subTrans.Requery
End Sub

I would like the subform to present the search results without pushing the
button, so I've copied the code to the On Key press event(of the txtSearch) but it doesn't work, any idea why?
 
Try On Change event instead.
 
Thanks, I found it..

me.txtSearch.text instead of me.txtSearch,
silly me...
 

Users who are viewing this thread

Back
Top Bottom