Advertisement

07.18.2008 at 08:16AM PDT, ID: 23577110
[x]
Attachment Details

How do I pass a parameter to an Access report query?

Asked by Eric_Trogdon in Access Reports, SQL Query Syntax, Access Forms

Tags: Microsoft, Access, 2003, VBA, SQL

I have the number I need in an unbound control on the report named ManagerID.  I need the report's record source query to know the value of ManagerID.  The record source query is attached.  Currently I have a parameter named ManID in there but I don't know how to pass the value of Me.ManagerID to the report query as ManID.  Consequently when I run the query, it pops up and asks me for the value of the parameter.  If I then put in the correct value the report comes up with the right data.Start Free Trial
1:
2:
3:
4:
5:
6:
PARAMETERS ManID Short;
SELECT a.TSK_ID, a.PREF, a.SFX, b.LVL, a.SD_NO, a.TITLE, a.RCVD_DT AS Received, b.DUE_DT AS Scheduled, b.EST_CST, a.ACTL_CST, a.PCTCOMPLETE, a.SCHEDULECODE, a.COSTCODE, a.TECHCODE, a.NOTE_1 AS [report comments], e.full_nm AS Manager, c2.Engineer, c3.ALCOPR, c4.GovtEngineer, a.ACTIVE_IND, a.STAT_ID
FROM ESIS_TSK AS a, esis_rev AS b, rptqryActiveESTEngineers AS c2, rptqryActiveESTALCOPRs AS c3, rptqryActiveESTGovtEngineers AS c4, esis_tsk_asgn AS d, esis_empl AS e
WHERE ( ( (a.TSK_ID)=[c2].[tsk_id] And (a.TSK_ID)=[c3].[tsk_id] And (a.TSK_ID)=[c4].[tsk_id]) AND ((b.LVL)=(select max(lvl) from esis_rev d where a.tsk_id = d.tsk_id)) AND ((a.ACTIVE_IND)="Y") AND ((a.STAT_ID)=1) AND ((a.TASKTYPE)=2) AND ((b.TSK_ID)=[a].[tsk_id])
and (a.tsk_id=d.tsk_id and d.empl_id=ManID and d.empl_id = e.empl_id) )
ORDER BY a.PREF, a.SFX;
[+][-]07.18.2008 at 08:21AM PDT, ID: 22036760

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Reports, SQL Query Syntax, Access Forms
Tags: Microsoft, Access, 2003, VBA, SQL
Sign Up Now!
Solution Provided By: JDettman
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.18.2008 at 08:27AM PDT, ID: 22036842

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:29AM PDT, ID: 22036871

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:40AM PDT, ID: 22036996

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:42AM PDT, ID: 22037009

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:45AM PDT, ID: 22037047

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:48AM PDT, ID: 22037075

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628