Form open code to select a parameter

PaulJK

Registered User.
Local time
Today, 00:53
Joined
Jul 4, 2002
Messages
60
I have a database with lists clients across the UK. I have now been asked to provide options where users can select clients grouped by geopraphical area e.g say clients in Scotland.

I can of course do this but having numerous identical forms where the source queries have different parameters depending on the regions required.

The only problem with this is that I would need numerous forms and queries. Additionally, there are options on the form to navigate to linked forms which would all need to be unique.

What I would like to have options on my main (Switchboard Type) Introduction Form to select the region. The code on the relevent command button would include the parameter. I would therefore not require the additional forms.

The open form codes includes:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmClients"
DoCmd.OpenForm stDocName, , , stLinkCriteria


I feel i need something after "frmClients" such as qryClients.ClientArea = "Not Scotland". Various attempts to incorporate something has created errors.

Any quidance on code would be appreciated.

Thank you...Paul
 
Maybe I am missing the point, but I would do this by selecting the geographic area from a dropdown list on the form that initiates the query, and using this selection in the query criteria.

Brian
 
I'd do it like this:
 

Attachments

Users who are viewing this thread

Back
Top Bottom