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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

too few parameters - Sub Query



 
 
Thread Tools Display Modes
  #1  
Old September 13th, 2005, 03:52 AM
Dianna
external usenet poster
 
Posts: n/a
Default too few parameters - Sub Query

Hi,

I am running a query which references a subquery. the criteria in the
subquery is set to a value in the form (Forms!Results!cboSeason)

I am receiving the error: too few parameters. Can I use a forms value in a
subquery? When I take it out it works. So far, from what I read, it does
not seem that I will be able to use a forms value.... (?)

If I can't use it, can I set up a 'Global Variable' in Access?

Any help would be great,
Thanks,
Dianna

  #2  
Old September 13th, 2005, 04:32 AM
Vincent Johns
external usenet poster
 
Posts: n/a
Default

Dianna wrote:

Hi,

I am running a query which references a subquery. the criteria in the
subquery is set to a value in the form (Forms!Results!cboSeason)

I am receiving the error: too few parameters. Can I use a forms value in a
subquery? When I take it out it works. So far, from what I read, it does
not seem that I will be able to use a forms value.... (?)


It's not clear to me what you're trying to do. Do the Query and
subquery that form the data sources of the Form give you the values you
want without producing an error message when you run them apart from the
Form? You should be able to display them in Datasheet view with an
included subdatasheet.

If I can't use it, can I set up a 'Global Variable' in Access?


I'm not sure if mine is an approved method, but I do this by creating a
Table named something like [T_Parameters] with just one record in it
that consists of a bunch of fields.

Any help would be great,
Thanks,
Dianna

  #3  
Old September 13th, 2005, 03:57 PM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default

I got a feeling that you are "running" this Query in VBA code, e.g. using
VBA to create a Recordset based on this Query due to error message post.

If this is the case, you need to resolve the Parameter
Forms!Results!cboSeason to explicit value before passing the Query to JET
for execution since JET doesn't know about Access Forms or Controls on
Access Forms.

The same Query probably works fine if you run the Query through the Access
GUI. The reason is that there is an Expression Service working with the GUI
resolves the reference to the Form Control for you automatically in the GUI.
The Expression Service, however, does not involve with VBA code execution.

--
HTH
Van T. Dinh
MVP (Access)


"Dianna" wrote in message
...
Hi,

I am running a query which references a subquery. the criteria in the
subquery is set to a value in the form (Forms!Results!cboSeason)

I am receiving the error: too few parameters. Can I use a forms value in
a
subquery? When I take it out it works. So far, from what I read, it does
not seem that I will be able to use a forms value.... (?)

If I can't use it, can I set up a 'Global Variable' in Access?

Any help would be great,
Thanks,
Dianna



  #4  
Old September 13th, 2005, 05:41 PM
Dianna
external usenet poster
 
Posts: n/a
Default

Thank Van. Thats what I thought
Dianna

"Van T. Dinh" wrote:

I got a feeling that you are "running" this Query in VBA code, e.g. using
VBA to create a Recordset based on this Query due to error message post.

If this is the case, you need to resolve the Parameter
Forms!Results!cboSeason to explicit value before passing the Query to JET
for execution since JET doesn't know about Access Forms or Controls on
Access Forms.

The same Query probably works fine if you run the Query through the Access
GUI. The reason is that there is an Expression Service working with the GUI
resolves the reference to the Form Control for you automatically in the GUI.
The Expression Service, however, does not involve with VBA code execution.

--
HTH
Van T. Dinh
MVP (Access)


"Dianna" wrote in message
...
Hi,

I am running a query which references a subquery. the criteria in the
subquery is set to a value in the form (Forms!Results!cboSeason)

I am receiving the error: too few parameters. Can I use a forms value in
a
subquery? When I take it out it works. So far, from what I read, it does
not seem that I will be able to use a forms value.... (?)

If I can't use it, can I set up a 'Global Variable' in Access?

Any help would be great,
Thanks,
Dianna




  #5  
Old September 13th, 2005, 06:01 PM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default

You're welcome ... Glad you worked it out ...

--
HTH
Van T. Dinh
MVP (Access)


"Dianna" wrote in message
...
Thank Van. Thats what I thought
Dianna



 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form for Inputing query parameters. Karthik General Discussion 2 September 4th, 2005 04:25 AM
adding 2 fields including null entries Jesse Running & Setting Up Queries 26 January 18th, 2005 05:31 PM
Parameters in the query T. W. Running & Setting Up Queries 7 December 14th, 2004 06:58 PM
datetime query with parameters problem MRFannon Running & Setting Up Queries 0 November 15th, 2004 07:29 PM
Too Few Parameters error Mail Merge Access Parameter Query Tony_VBACoder Mailmerge 3 September 14th, 2004 12:15 PM


All times are GMT +1. The time now is 10:38 AM.


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