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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |