Query Question

R

Ryan

Hello, I have a query that i would like to filter when i click a button on my
form, that uses a field on the form to filter the query. I do not to display
info in a report or form, or table but to export to excel. i cannot figure
out how to do this....any help would be appreciated.

Ryan
 
J

Jerry Whittle

Create a form named something like frmParameter. On the form have a text box
named something like txtParameter.

On this same form put a command button and on the On Click event of the
button put:

DoCmd.OpenQuery "qryParameter"
Me.Visible = False

Create a query named something like qryParameter with the line below in the
criteria of the correct field.

[Forms]![frmParameter]![txtParameter]

The form Parameter must stay open for the query to run; however, it can be
minimized or even invisible.
 

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

Top