Form Filtering

J

Jamie Dickerson

I have a form ToolingIn based on a query. Upon opening the form the user is
prompted to enter a date. This filters the records for the date entered. In
order to filter for a new date the user must close the form and reopen. I am
sure there is a better way to do this. I played with the command button
wizard a bit but with no success. I first tried the run query command which
does prompt the user for a new date but then opens the query. I would like
it to open the form. I also tried using the openform command but that does
nothing. Any help would be appreciated.


Thanks In Advance.
 
M

Marshall Barton

Jamie said:
I have a form ToolingIn based on a query. Upon opening the form the user is
prompted to enter a date. This filters the records for the date entered. In
order to filter for a new date the user must close the form and reopen. I am
sure there is a better way to do this. I played with the command button
wizard a bit but with no success. I first tried the run query command which
does prompt the user for a new date but then opens the query. I would like
it to open the form. I also tried using the openform command but that does
nothing.


Add an unbound text box to the form's Header section for
users to enter the date. Then change the query's critreia
from your prompt string to:
Forms![name of the form].[name of the text box]
 
A

AccessVandal via AccessMonster.com

I believe you're using the query criteria parameter in the form's
recordsource for the input. You can just requery the form again via the
command button.

Private Sub Command1_Click()
Me.Requery
End Sub

The example given by Marshall does prompt user input but instead use a
textbox or combobox to query the criteria.

Have a look at a sample from Allen Browne this.
http://allenbrowne.com/ser-62.html
http://allenbrowne.com/AppFindAsUType.html
 
A

AccessVandal via AccessMonster.com

Typos!

The example given by Marshall does not prompt user input but instead use a
textbox or combobox to query the criteria.

AccessVandal wrote:
 

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