Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / January 2005

Tip: Looking for answers? Try searching our database.

Apply a filter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
anonymous@discussions.microsoft.com - 31 Jan 2005 16:37 GMT
Please help - I am sure the answer to this is soooo easy
but I am going around in circles.

I wish to filter a query based on the name selected by a
dropdown box on a form.  e.g   I have 650 clients.  By
selecting one name from a form I wish to filter the query
so that I can create a letter to that one client.

Can I do this with a macro?
fredg - 31 Jan 2005 16:53 GMT
> Please help - I am sure the answer to this is soooo easy
> but I am going around in circles.
[quoted text clipped - 5 lines]
>
> Can I do this with a macro?

Set the query criteria for the ClientID field to:
forms!FormName!ComboName
Make sure the datatype of the combo box's bound column is the same as
the datatype of the query field.

The form must be open when the query is run.
If this is for a report (using this query as it's record source), the
usual way is to open the form from the Report's Open event using:
DoCmd.OpenForm "FormName", , , , , acDialog

Add a command button to the form. Code it's click event:
Me.Visible = False

Close the form in the Report's Close event:
DoCmd.Close acForm, "FormName"

When you wish to run the report, open the report.
It will open the form.
Select the client.
Click on the command button.
The Report will run. When you close the report it will close the form.


Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.