PDA

View Full Version : filter by VBA



ironj32
05-30-2007, 08:04 AM
i am trying to filter a record by code. i have a form "frmVendorInfo", a text box "txtID" who's control source is "ID"
i want it to just filter the current record. i have tried:

Private sub cmdUpdate_click()

docomd.applyfilter ,
...CurrentRecord
...me.txtID.value
...txtID.value
...ID.value

nothing seems to filter any results. any suggestions?

mattj
05-31-2007, 11:36 AM
Maybe try:

Me.Filter = "ID = " & Me.txtID
Me.FilterOn = True


HTH
Matt

ironj32
05-31-2007, 11:43 AM
Thank You!!! that works.

mattj
05-31-2007, 11:47 AM
Glad I could help!