Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Filter by multiple fields

$
0
0
Hi -

I am a relative novice to Access and I want to place a button on a form whereby I can filter that form by any one, two, or all, of three fields ("Rx_ID", "First name", and "Last Name"). What I want to allow is for a user to click a "Filter by..." button which activates a dialogue box that allows valid filter ctiteria to be entered into any one, two or all three fields - then to click "OK" and have the form filtered by whatever criteria has been set (or if the record - or set of records - does not exist, to return a "Sorry but no records exist based on those search criteria"). I can do this in FileMaker - but don't know how in Access...

I have found the Me.Filter command...

Private Sub FilterBy_Click()
Me.Filter =
End Sub

...but cannot find how to apply it to my situation

"[Rx_ID] = " & "[First name] = " & "[Last Name] = "

I know will I also need another button to turn the filter off - but at least the code for that is straightforward... (I hope)...

Private Sub FilterOff_Click()
Me.Filter = ""
Me.FilterOn = False
End Sub

Any help or advice would be appreciated.
Cheers,
Rramjet.

Viewing all articles
Browse latest Browse all 13329

Trending Articles