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.

Multiple queries same parameter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kathy - 05 Jan 2005 18:09 GMT
I have multiple queries using the same parameter, Is there a way to store the
parameter on a form so it can be reference. Example:The first time the user
go into the application, there is a form for reports, when clicking the
command button the user will enter plant code if it doesn't exist or will
pick up parameter and not ask the user.
- 05 Jan 2005 19:27 GMT
hi,
is the plant code the parameter?
if so then in your queries you could enter this
[forms]![yourform]![Plantcodetextbox] as the criteria
(parameter).

>-----Original Message-----
>I have multiple queries using the same parameter, Is there a way to store the
[quoted text clipped - 3 lines]
>pick up parameter and not ask the user.
>.
BruceM - 06 Jan 2005 15:43 GMT
Just to expand a little, create a form with unbound text boxes or combo boxes
for the field or fields that will be used as parameters.  Give the form and
the controls short, simple names.  For now, the form is frmParam, and the
combo box on the form is cboName.  Set the form properties to Pop-up and
Modal.  Add a command button to the form, with the Click event set to
Me.Visible = False.  In the underlying query for a report, reference the form
on the Criteria line thus:
Forms![frmParam]![cboName]
Back to the report, add the following to the On Open event:
DoCmd.OpenForm "frmParam", , , , , acDialog
When you open the report, it will open the form and then wait for a response
from you.  When you enter the parameter and click the command button (which
can have a label "Open Report", but which will actually hide the form), the
parameters will be applied to the report.
Ordinarily I would add code to the report's On Close event to also close
frmParam, but you will need to keep it open until you are done with all of
the reports.  I think it will work to have the code to open the form in the
Open event of each report, and even if the form is already open but hidden it
will appear as it should.  If not, you will need to do something like open
frmParam ahead of time but make it invisible, and instead of opening it when
you open a report you would make it visible instead.
This is kind of a lot of stuff all at once.  I would suggest trying this
with a single report to get familiar with how it works.  Later you can try
adding other reports.  

> hi,
> is the plant code the parameter?
[quoted text clipped - 13 lines]
> >pick up parameter and not ask the user.
> >.
 
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.