Filtering from a textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I make a button to apply a filter that gets it criteria from a textbox?
 
Assuming you want to filter a form's recordset, try putting the following
code in the click event of your button...

me.filter = "YourField = " & textboxname.value 'if number
me.filter = "YourField = '" & textboxname.value & "'" 'if text
me.filter = "YourField = #" & format(textboxname.value,"mmm dd yyyy") & "#"
'if date

and then
me.filteron = true
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top