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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Enter Parameter Value on a subform



 
 
Thread Tools Display Modes
  #1  
Old February 11th, 2007, 10:33 PM posted to microsoft.public.access.forms
ChuckW
external usenet poster
 
Posts: 182
Default Enter Parameter Value on a subform

Hi,

I have a main form called AddBlend and a subform called BlendReport. The
BlendReport for a combo box called ComboBlend and a text box called txtDate.
There is then a report based on a Query called BlendNameQTY. The query has
the parameter values in the criteria section so it looks for what is in the
combo box and text and then runs the query. When I added this subform to my
main form and run the report I get a message"Enter Parameter Value
Forms!BlendReport!ComboBlend" and then "Enter Parameter Value
Forms!BlendReport!TxtDate". If I click ok the report give me everything.
However, if I go to the forms list and then select the subform only and then
enter a value in the combo box and text box the report (and query) run
correctly. But if it is a subform it does not. Can anyone help?

Thanks,
--
Chuck W
  #2  
Old February 11th, 2007, 11:40 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Enter Parameter Value on a subform

On Sun, 11 Feb 2007 14:33:00 -0800, ChuckW wrote:

Hi,

I have a main form called AddBlend and a subform called BlendReport. The
BlendReport for a combo box called ComboBlend and a text box called txtDate.
There is then a report based on a Query called BlendNameQTY. The query has
the parameter values in the criteria section so it looks for what is in the
combo box and text and then runs the query. When I added this subform to my
main form and run the report I get a message"Enter Parameter Value
Forms!BlendReport!ComboBlend" and then "Enter Parameter Value
Forms!BlendReport!TxtDate". If I click ok the report give me everything.
However, if I go to the forms list and then select the subform only and then
enter a value in the combo box and text box the report (and query) run
correctly. But if it is a subform it does not. Can anyone help?


Referencing a control on a Subform is a bit peculiar. A Subform is not
a member of the Forms collection, and it isn't open in its own right.
You need to navigate to it through the name of the main form, and the
name of the Subform control on that form. The "subform control" is the
box containing the Subform, which may or may not have the same name as
the form within it; if you used the Access form builder, it probably
does. Try

[Forms]![AddBlend]![BlendReport].Form![ComboBlend]
[Forms]![AddBlend]![BlendReport].Form![txtDate]

as criteria.

John W. Vinson [MVP]

  #3  
Old February 12th, 2007, 12:31 PM posted to microsoft.public.access.forms
ChuckW
external usenet poster
 
Posts: 182
Default Enter Parameter Value on a subform

Thanks John. Your suggestion worked.
--
Chuck W


"John W. Vinson" wrote:

On Sun, 11 Feb 2007 14:33:00 -0800, ChuckW wrote:

Hi,

I have a main form called AddBlend and a subform called BlendReport. The
BlendReport for a combo box called ComboBlend and a text box called txtDate.
There is then a report based on a Query called BlendNameQTY. The query has
the parameter values in the criteria section so it looks for what is in the
combo box and text and then runs the query. When I added this subform to my
main form and run the report I get a message"Enter Parameter Value
Forms!BlendReport!ComboBlend" and then "Enter Parameter Value
Forms!BlendReport!TxtDate". If I click ok the report give me everything.
However, if I go to the forms list and then select the subform only and then
enter a value in the combo box and text box the report (and query) run
correctly. But if it is a subform it does not. Can anyone help?


Referencing a control on a Subform is a bit peculiar. A Subform is not
a member of the Forms collection, and it isn't open in its own right.
You need to navigate to it through the name of the main form, and the
name of the Subform control on that form. The "subform control" is the
box containing the Subform, which may or may not have the same name as
the form within it; if you used the Access form builder, it probably
does. Try

[Forms]![AddBlend]![BlendReport].Form![ComboBlend]
[Forms]![AddBlend]![BlendReport].Form![txtDate]

as criteria.

John W. Vinson [MVP]


  #4  
Old January 28th, 2010, 09:56 PM posted to microsoft.public.access.forms
Sara M
external usenet poster
 
Posts: 14
Default Enter Parameter Value on a subform

I am having the same problem, but my control is named correctly as I used the
Builder Tool to create the criteria.

Enter Parameter Value: Forms!2ResponseFormA!2ResponseFormB.Form!QNoID

My query criteria is
[QNoID]=[Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID]

Sometimes I can get it to work by opening the query (while the form is open)
and using the Builder Tool again to create the criteria. After I close the
form and/or the database, I get the same messag again when I reopen the form.

Thanks for your help!

"John W. Vinson" wrote:

On Sun, 11 Feb 2007 14:33:00 -0800, ChuckW wrote:

Hi,

I have a main form called AddBlend and a subform called BlendReport. The
BlendReport for a combo box called ComboBlend and a text box called txtDate.
There is then a report based on a Query called BlendNameQTY. The query has
the parameter values in the criteria section so it looks for what is in the
combo box and text and then runs the query. When I added this subform to my
main form and run the report I get a message"Enter Parameter Value
Forms!BlendReport!ComboBlend" and then "Enter Parameter Value
Forms!BlendReport!TxtDate". If I click ok the report give me everything.
However, if I go to the forms list and then select the subform only and then
enter a value in the combo box and text box the report (and query) run
correctly. But if it is a subform it does not. Can anyone help?


Referencing a control on a Subform is a bit peculiar. A Subform is not
a member of the Forms collection, and it isn't open in its own right.
You need to navigate to it through the name of the main form, and the
name of the Subform control on that form. The "subform control" is the
box containing the Subform, which may or may not have the same name as
the form within it; if you used the Access form builder, it probably
does. Try

[Forms]![AddBlend]![BlendReport].Form![ComboBlend]
[Forms]![AddBlend]![BlendReport].Form![txtDate]

as criteria.

John W. Vinson [MVP]


  #5  
Old January 29th, 2010, 01:33 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Enter Parameter Value on a subform

On Thu, 28 Jan 2010 13:56:01 -0800, Sara M
wrote:

I am having the same problem, but my control is named correctly as I used the
Builder Tool to create the criteria.

Enter Parameter Value: Forms!2ResponseFormA!2ResponseFormB.Form!QNoID

My query criteria is
[QNoID]=[Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID]

Sometimes I can get it to work by opening the query (while the form is open)
and using the Builder Tool again to create the criteria. After I close the
form and/or the database, I get the same messag again when I reopen the form.


That's odd. It suggests that 2ResponseFormA might not be open at the time.

If it is, try opening the query in SQL view and inserting

PARAMETERS [Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID] Long;

before the SELECT keyword in the query.
--

John W. Vinson [MVP]
  #6  
Old February 1st, 2010, 03:15 PM posted to microsoft.public.access.forms
Sara M
external usenet poster
 
Posts: 14
Default Enter Parameter Value on a subform

When I change my SQL query to include your suggestion, I get "Syntax error in
PARAMETER clause."

My updated query, which is the row source for [RespNo] control on
[2ResponseFormC], a subform of B:

PARAMETERS [Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID] Long
SELECT DISTINCT [3Responses].RId, [3Responses].Response AS RespNo,
[3Responses].QuestID, [2RespQryA].QNoID, [2RespQryA].SurvType,
[2RespQryA].QCat, [2RespQryA].QNo
FROM 2RespQryA INNER JOIN 3Responses ON [2RespQryA].QNoID =
[3Responses].QuestID
WHERE
((([2RespQryA].QNoID)=[Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID]))
ORDER BY [3Responses].RId;

When I have Subform [2ResponseFormB] open in its own window, I can set the
WHERE clause as [2RespQryA].QNoID=[Forms]![2ResponseFormB].[QNoID] and it
works fine. But when I open [2ReponseFormA], the I get the Parameter Value
message again.



"John W. Vinson" wrote:

On Thu, 28 Jan 2010 13:56:01 -0800, Sara M
wrote:

I am having the same problem, but my control is named correctly as I used the
Builder Tool to create the criteria.

Enter Parameter Value: Forms!2ResponseFormA!2ResponseFormB.Form!QNoID

My query criteria is
[QNoID]=[Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID]

Sometimes I can get it to work by opening the query (while the form is open)
and using the Builder Tool again to create the criteria. After I close the
form and/or the database, I get the same messag again when I reopen the form.


That's odd. It suggests that 2ResponseFormA might not be open at the time.

If it is, try opening the query in SQL view and inserting

PARAMETERS [Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID] Long;

before the SELECT keyword in the query.
--

John W. Vinson [MVP]
.

  #7  
Old February 1st, 2010, 05:00 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Enter Parameter Value on a subform

On Mon, 1 Feb 2010 07:15:01 -0800, Sara M
wrote:

When I change my SQL query to include your suggestion, I get "Syntax error in
PARAMETER clause."

My updated query, which is the row source for [RespNo] control on
[2ResponseFormC], a subform of B:

PARAMETERS [Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID] Long


The only thing I can see is that there should be a semicolon; after Long.
--

John W. Vinson [MVP]
  #8  
Old February 1st, 2010, 06:46 PM posted to microsoft.public.access.forms
Sara M
external usenet poster
 
Posts: 14
Default Enter Parameter Value on a subform

Even with the semicolon, I still get the "Enter Parameter Value" message.

"John W. Vinson" wrote:

On Mon, 1 Feb 2010 07:15:01 -0800, Sara M
wrote:

When I change my SQL query to include your suggestion, I get "Syntax error in
PARAMETER clause."

My updated query, which is the row source for [RespNo] control on
[2ResponseFormC], a subform of B:

PARAMETERS [Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID] Long


The only thing I can see is that there should be a semicolon; after Long.
--

John W. Vinson [MVP]
.

  #9  
Old February 1st, 2010, 07:07 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Enter Parameter Value on a subform

The syntax you're using implies that you're trying to read the value
contained in control QNoID on a subform of form 2ResponseFormA. Are you
certain that the name of the subform control on form 2ResponseFormA is, in
fact, 2ResponseFormB? Depending on how you added the subform, the name of
the subform control may be different than the name of the form being used as
a subform.

I assume form 2ResponseFormA is open when you're running the query. (Access
won't open the form for you.)

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Sara M" wrote in message
...
Even with the semicolon, I still get the "Enter Parameter Value" message.

"John W. Vinson" wrote:

On Mon, 1 Feb 2010 07:15:01 -0800, Sara M

wrote:

When I change my SQL query to include your suggestion, I get "Syntax
error in
PARAMETER clause."

My updated query, which is the row source for [RespNo] control on
[2ResponseFormC], a subform of B:

PARAMETERS [Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID] Long


The only thing I can see is that there should be a semicolon; after Long.
--

John W. Vinson [MVP]
.



  #10  
Old February 1st, 2010, 09:26 PM posted to microsoft.public.access.forms
Sara M
external usenet poster
 
Posts: 14
Default Enter Parameter Value on a subform

See below.

"Douglas J. Steele" wrote:

The syntax you're using implies that you're trying to read the value
contained in control QNoID on a subform of form 2ResponseFormA.


Yes, that's correct.

Are you
certain that the name of the subform control on form 2ResponseFormA is, in
fact, 2ResponseFormB? Depending on how you added the subform, the name of
the subform control may be different than the name of the form being used as
a subform.


On the property sheet, it shows the source object is "2ResponseFormC" and
the Name is "2ResponseFormC," likewise for FormB.


I assume form 2ResponseFormA is open when you're running the query. (Access
won't open the form for you.)


Yes, A is open. A is linked to B by "SurvID", B is linked to C by
"SurvRespID." Form A shows the basic information on the survey. Form B shows
the question and related comments. Form C (continuous) allows for multiple
answers to the questions in Form B.

I can run the query separately and it works fine and pulls the approrpriate
data. But when it is the row source for field [QNoID], I get the Enter
parameter value message.


--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Sara M" wrote in message
...
Even with the semicolon, I still get the "Enter Parameter Value" message.

"John W. Vinson" wrote:

On Mon, 1 Feb 2010 07:15:01 -0800, Sara M

wrote:

When I change my SQL query to include your suggestion, I get "Syntax
error in
PARAMETER clause."

My updated query, which is the row source for [RespNo] control on
[2ResponseFormC], a subform of B:

PARAMETERS [Forms]![2ResponseFormA]![2ResponseFormB].[Form]![QNoID] Long

The only thing I can see is that there should be a semicolon; after Long.
--

John W. Vinson [MVP]
.



.

 




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:51 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.