A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

subreport not recognizing query reference



 
 
Thread Tools Display Modes
  #1  
Old December 22nd, 2009, 02:47 PM posted to microsoft.public.access.reports
dfeigen115
external usenet poster
 
Posts: 18
Default subreport not recognizing query reference

I have a form that once filled in completed opens a report. the report has a
subreport. I keep the completed form open until after the report has
successfully displayed. The main report is opened using the DoCmd.OpenReport
function.

The subreport contains data from an existing table in the DB. The subreport
content is selected based on a query that contains a reference to a data
value on the still open form. The format for the reference is:
[forms]![formname]![fieldname]

When the subrport is being opened it doesn't recognize the reference and
prompts for the data value.

Any assistance woudl be appreciated.
Dan
  #2  
Old December 22nd, 2009, 03:14 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default subreport not recognizing query reference

dfeigen115 wrote:

I have a form that once filled in completed opens a report. the report has a
subreport. I keep the completed form open until after the report has
successfully displayed. The main report is opened using the DoCmd.OpenReport
function.

The subreport contains data from an existing table in the DB. The subreport
content is selected based on a query that contains a reference to a data
value on the still open form. The format for the reference is:
[forms]![formname]![fieldname]

When the subrport is being opened it doesn't recognize the reference and
prompts for the data value.



Whenever you get a prompt from a query, it means that Access
can not find whatever you are prompted to enter. It's
commonly just a misspelling of something.

--
Marsh
MVP [MS Access]
  #3  
Old December 22nd, 2009, 04:07 PM posted to microsoft.public.access.reports
dfeigen115
external usenet poster
 
Posts: 18
Default subreport not recognizing query reference

Yep, I'm aware of that and have checked (and rechecked) the spelling etc. I
aslso completed one additional test, that is to have the form treat the
subreport as a seperate report, ie opening it directly using the same query.
This test worked, therefore validating the query format.

when i try to open it as a true subreport, it fails (prompts for the data)
Dan

"Marshall Barton" wrote:

dfeigen115 wrote:

I have a form that once filled in completed opens a report. the report has a
subreport. I keep the completed form open until after the report has
successfully displayed. The main report is opened using the DoCmd.OpenReport
function.

The subreport contains data from an existing table in the DB. The subreport
content is selected based on a query that contains a reference to a data
value on the still open form. The format for the reference is:
[forms]![formname]![fieldname]

When the subrport is being opened it doesn't recognize the reference and
prompts for the data value.



Whenever you get a prompt from a query, it means that Access
can not find whatever you are prompted to enter. It's
commonly just a misspelling of something.

--
Marsh
MVP [MS Access]
.

  #4  
Old December 22nd, 2009, 05:24 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default subreport not recognizing query reference

If you are certain that the parameter is spelled correctly,
then either the form is being closed before the main report
is closed or there is something seriously out of whack or
corrupted.
--
Marsh
MVP [MS Access]


dfeigen115 wrote:
Yep, I'm aware of that and have checked (and rechecked) the spelling etc. I
aslso completed one additional test, that is to have the form treat the
subreport as a seperate report, ie opening it directly using the same query.
This test worked, therefore validating the query format.

when i try to open it as a true subreport, it fails (prompts for the data)
Dan

"Marshall Barton" wrote:

dfeigen115 wrote:

I have a form that once filled in completed opens a report. the report has a
subreport. I keep the completed form open until after the report has
successfully displayed. The main report is opened using the DoCmd.OpenReport
function.

The subreport contains data from an existing table in the DB. The subreport
content is selected based on a query that contains a reference to a data
value on the still open form. The format for the reference is:
[forms]![formname]![fieldname]

When the subrport is being opened it doesn't recognize the reference and
prompts for the data value.



Whenever you get a prompt from a query, it means that Access
can not find whatever you are prompted to enter. It's
commonly just a misspelling of something.


  #5  
Old December 22nd, 2009, 05:35 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default subreport not recognizing query reference

Explain what you mean by "I keep the completed form open until after the
report has successfully displayed." How/when do you close the form? Try just
set its visible property to false rather than closing to see if the error
goes away.

--
Duane Hookom
Microsoft Access MVP


"dfeigen115" wrote:

Yep, I'm aware of that and have checked (and rechecked) the spelling etc. I
aslso completed one additional test, that is to have the form treat the
subreport as a seperate report, ie opening it directly using the same query.
This test worked, therefore validating the query format.

when i try to open it as a true subreport, it fails (prompts for the data)
Dan

"Marshall Barton" wrote:

dfeigen115 wrote:

I have a form that once filled in completed opens a report. the report has a
subreport. I keep the completed form open until after the report has
successfully displayed. The main report is opened using the DoCmd.OpenReport
function.

The subreport contains data from an existing table in the DB. The subreport
content is selected based on a query that contains a reference to a data
value on the still open form. The format for the reference is:
[forms]![formname]![fieldname]

When the subrport is being opened it doesn't recognize the reference and
prompts for the data value.



Whenever you get a prompt from a query, it means that Access
can not find whatever you are prompted to enter. It's
commonly just a misspelling of something.

--
Marsh
MVP [MS Access]
.

  #6  
Old December 22nd, 2009, 06:05 PM posted to microsoft.public.access.reports
dfeigen115
external usenet poster
 
Posts: 18
Default subreport not recognizing query reference

once the form has been filled in, the user clicks the submit button at which
time all of the data is validated and processed. The use is prompted to
correct any invalid or missing data conditions. Once the forom passes the
validation various tables are updated to reflect the information gathered.
The last sequence of events (see below) is to display a msgbox, followed by
opening and displaying the report and it's subreport. Once the report is
displayed, the orginal data entry form is closed.

MsgBox ("CACR " & Me.CACR_Number & " was successfully added")
DoCmd.OpenReport "CACR-form", acViewPreview, , strwhere
DoCmd.Close acForm, "addcacrform"

Dan

"Duane Hookom" wrote:

Explain what you mean by "I keep the completed form open until after the
report has successfully displayed." How/when do you close the form? Try just
set its visible property to false rather than closing to see if the error
goes away.

--
Duane Hookom
Microsoft Access MVP


"dfeigen115" wrote:

Yep, I'm aware of that and have checked (and rechecked) the spelling etc. I
aslso completed one additional test, that is to have the form treat the
subreport as a seperate report, ie opening it directly using the same query.
This test worked, therefore validating the query format.

when i try to open it as a true subreport, it fails (prompts for the data)
Dan

"Marshall Barton" wrote:

dfeigen115 wrote:

I have a form that once filled in completed opens a report. the report has a
subreport. I keep the completed form open until after the report has
successfully displayed. The main report is opened using the DoCmd.OpenReport
function.

The subreport contains data from an existing table in the DB. The subreport
content is selected based on a query that contains a reference to a data
value on the still open form. The format for the reference is:
[forms]![formname]![fieldname]

When the subrport is being opened it doesn't recognize the reference and
prompts for the data value.


Whenever you get a prompt from a query, it means that Access
can not find whatever you are prompted to enter. It's
commonly just a misspelling of something.

--
Marsh
MVP [MS Access]
.

  #7  
Old December 22nd, 2009, 06:21 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default subreport not recognizing query reference

Don't close the form. As Marsh has suggested, the form is not available when
needed. Hide it.

--
Duane Hookom
Microsoft Access MVP


"dfeigen115" wrote:

once the form has been filled in, the user clicks the submit button at which
time all of the data is validated and processed. The use is prompted to
correct any invalid or missing data conditions. Once the forom passes the
validation various tables are updated to reflect the information gathered.
The last sequence of events (see below) is to display a msgbox, followed by
opening and displaying the report and it's subreport. Once the report is
displayed, the orginal data entry form is closed.

MsgBox ("CACR " & Me.CACR_Number & " was successfully added")
DoCmd.OpenReport "CACR-form", acViewPreview, , strwhere
DoCmd.Close acForm, "addcacrform"

Dan

"Duane Hookom" wrote:

Explain what you mean by "I keep the completed form open until after the
report has successfully displayed." How/when do you close the form? Try just
set its visible property to false rather than closing to see if the error
goes away.

--
Duane Hookom
Microsoft Access MVP


"dfeigen115" wrote:

Yep, I'm aware of that and have checked (and rechecked) the spelling etc. I
aslso completed one additional test, that is to have the form treat the
subreport as a seperate report, ie opening it directly using the same query.
This test worked, therefore validating the query format.

when i try to open it as a true subreport, it fails (prompts for the data)
Dan

"Marshall Barton" wrote:

dfeigen115 wrote:

I have a form that once filled in completed opens a report. the report has a
subreport. I keep the completed form open until after the report has
successfully displayed. The main report is opened using the DoCmd.OpenReport
function.

The subreport contains data from an existing table in the DB. The subreport
content is selected based on a query that contains a reference to a data
value on the still open form. The format for the reference is:
[forms]![formname]![fieldname]

When the subrport is being opened it doesn't recognize the reference and
prompts for the data value.


Whenever you get a prompt from a query, it means that Access
can not find whatever you are prompted to enter. It's
commonly just a misspelling of something.

--
Marsh
MVP [MS Access]
.

  #8  
Old December 22nd, 2009, 06:30 PM posted to microsoft.public.access.reports
dfeigen115
external usenet poster
 
Posts: 18
Default subreport not recognizing query reference

I commented out the close form statement and still get the reference error
indicating it can't find either the form or the control on the form.
Dan

"Marshall Barton" wrote:

If you are certain that the parameter is spelled correctly,
then either the form is being closed before the main report
is closed or there is something seriously out of whack or
corrupted.
--
Marsh
MVP [MS Access]


dfeigen115 wrote:
Yep, I'm aware of that and have checked (and rechecked) the spelling etc. I
aslso completed one additional test, that is to have the form treat the
subreport as a seperate report, ie opening it directly using the same query.
This test worked, therefore validating the query format.

when i try to open it as a true subreport, it fails (prompts for the data)
Dan

"Marshall Barton" wrote:

dfeigen115 wrote:

I have a form that once filled in completed opens a report. the report has a
subreport. I keep the completed form open until after the report has
successfully displayed. The main report is opened using the DoCmd.OpenReport
function.

The subreport contains data from an existing table in the DB. The subreport
content is selected based on a query that contains a reference to a data
value on the still open form. The format for the reference is:
[forms]![formname]![fieldname]

When the subrport is being opened it doesn't recognize the reference and
prompts for the data value.


Whenever you get a prompt from a query, it means that Access
can not find whatever you are prompted to enter. It's
commonly just a misspelling of something.


.

  #9  
Old December 23rd, 2009, 12:35 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default subreport not recognizing query reference

Can you now see the form while the report is open? (You may
have to use the Window menu.)

FYI, Your VBA code continues to execute after **initiating**
the OpenReport. The report has not even processed any
records by the time the OpenReport method is done and the
code moves on.

I strongly suggest that in the future you use Copy/Paste to
post any code, queries and expressions. This way we can see
exactly what you have and be sure any typos were not caused
by retyping. At least, we won't have to guess what might be
in the real code. E.g, it might help if you posted the code
that sets the strWhere variable and the variable's value
when the report is opened.

It;s probably not the issue, but you should understand that
a report can cause a prompt if a control is bound to, or
uses an expression with a nonexistent field. Sorting and
Grouping is another place that can generate a prompt.

If the query runs by itself while the form is open but the
report does not, then check the prompt carefully to make
sure it is what you think it is.
--
Marsh
MVP [MS Access]


dfeigen115 wrote:
I commented out the close form statement and still get the reference error
indicating it can't find either the form or the control on the form.

"Marshall Barton" wrote:
If you are certain that the parameter is spelled correctly,
then either the form is being closed before the main report
is closed or there is something seriously out of whack or
corrupted.


dfeigen115 wrote:
Yep, I'm aware of that and have checked (and rechecked) the spelling etc. I
aslso completed one additional test, that is to have the form treat the
subreport as a seperate report, ie opening it directly using the same query.
This test worked, therefore validating the query format.

when i try to open it as a true subreport, it fails (prompts for the data)
Dan

"Marshall Barton" wrote:

dfeigen115 wrote:

I have a form that once filled in completed opens a report. the report has a
subreport. I keep the completed form open until after the report has
successfully displayed. The main report is opened using the DoCmd.OpenReport
function.

The subreport contains data from an existing table in the DB. The subreport
content is selected based on a query that contains a reference to a data
value on the still open form. The format for the reference is:
[forms]![formname]![fieldname]

When the subrport is being opened it doesn't recognize the reference and
prompts for the data value.


Whenever you get a prompt from a query, it means that Access
can not find whatever you are prompted to enter. It's
commonly just a misspelling of something.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.