Report based on query keeps prompting for value

  • Thread starter Pamela via AccessMonster.com
  • Start date
P

Pamela via AccessMonster.com

Hello,'

I have a button on a subform which opens another form. This works fine, but
on the form that is opened, there is a button to preview a report. The
report is based on the following query:

SELECT tblTerm.*, tblTerm.TermID
FROM tblTaskAudit INNER JOIN tblTerm ON tblTaskAudit.RecID = tblTerm.TermID
WHERE (((tblTerm.TermID)=[Forms]![frmTerm]![RecID]));

The Form which calls this report, frmTerm, has a value in RecID, but the
query the report is based on keeps prompting for the record ID, even though
the query criteria is that TermID = the forms's RecID.

I don't understand why the query keeps prompting? Once the data is entered
into the prompt, the report runs fine...just don't understans why it's
prompting me. tblTerm & tblTaskAudit are related via RecID.

Thanks.
 
D

Duane Hookom

Do you have a control on the form named RecID? Does the form remain open as
the report is opened?
 
A

Al Camp

Pamela,
There may not be a parameter in your query... it may be on the report
itself, or even a subreport if there is one.
Somewhere there's a variable being referred to... like in a calculation,
or perhaps an old parameter you had when you first designed the report, that
the query does not provide, or even a slight misspelling.
= [Prce] * [Qty]
would cause a parameter prompt because of Price misspelling.

You wrote...
The Form which calls this report, frmTerm, has a value in RecID, but the
query the report is based on keeps prompting for the record ID, even
though...
Right there... you refer to RecID and "record ID"... that's just what
causes a bug like this.
As the old saying goes, "It's in there!"

Backup your report with a different name, then delete a third of the
fields on the original. Run the report... does it fail?
If yes, paste those back, and delete the 2nd third... etc... till you at
least know "generally" where it might be. Keep narrowing down...
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Pamela via AccessMonster.com said:
Hello,'

I have a button on a subform which opens another form. This works fine,
but
on the form that is opened, there is a button to preview a report. The
report is based on the following query:

SELECT tblTerm.*, tblTerm.TermID
FROM tblTaskAudit INNER JOIN tblTerm ON tblTaskAudit.RecID =
tblTerm.TermID
WHERE (((tblTerm.TermID)=[Forms]![frmTerm]![RecID]));

The Form which calls this report, frmTerm, has a value in RecID, but the
query the report is based on keeps prompting for the record ID, even
though
the query criteria is that TermID = the forms's RecID.

I don't understand why the query keeps prompting? Once the data is
entered
into the prompt, the report runs fine...just don't understans why it's
prompting me. tblTerm & tblTaskAudit are related via RecID.

Thanks.
 
P

Pamela via AccessMonster.com

Yes. There is a control on the Form (frmTerm) named [RecID] & it contains
the current record number. Yes, the form is open when the report is opened.

Thanks.

Duane said:
Do you have a control on the form named RecID? Does the form remain open as
the report is opened?
[quoted text clipped - 19 lines]
 
P

Pamela via AccessMonster.com

Great! That was it! I had made changes to the form & underlying table...
there was a control on the erport whose control source was RecID, whereas it
should have been tblTerm.TermID. Works like it should now.

Thanks a bunch!

Al said:
Pamela,
There may not be a parameter in your query... it may be on the report
itself, or even a subreport if there is one.
Somewhere there's a variable being referred to... like in a calculation,
or perhaps an old parameter you had when you first designed the report, that
the query does not provide, or even a slight misspelling.
= [Prce] * [Qty]
would cause a parameter prompt because of Price misspelling.

You wrote...
The Form which calls this report, frmTerm, has a value in RecID, but the
query the report is based on keeps prompting for the record ID, even
though...
Right there... you refer to RecID and "record ID"... that's just what
causes a bug like this.
As the old saying goes, "It's in there!"

Backup your report with a different name, then delete a third of the
fields on the original. Run the report... does it fail?
If yes, paste those back, and delete the 2nd third... etc... till you at
least know "generally" where it might be. Keep narrowing down...
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
[quoted text clipped - 19 lines]
 

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