PC Review


Reply
Thread Tools Rate Thread

3061 too few paramters on db.execute - Huh?

 
 
Tony Vrolyk
Guest
Posts: n/a
 
      20th Apr 2006
Any reason a make table query that will run succesfully when double-clicked
will generate a 3061 too few parameters error?

The thing that gets me is that this has been working for ages and I just
made a very minor tweak in the query and suddenly it stopped working. I can
run it manually by double-clicking but when I run it from code I get that
error.

Here is what I am doing

Dim db As DAO.Database
Set db = CurrentDb()
db.Execute "qry_Participants_NWExportMakeTable"

Pretty smiple. The query does reference a form for its criteria. The form is
open and the field referenced has data (A date in this case). this is really
buggin me. any ideas?

Tony


 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      20th Apr 2006
Hi,
db.Execute does not evaluate form references. so you have to either replace
reference to form's parameter with actual value (by modifying SQL for
example) or use docmd.openquery

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

"Tony Vrolyk" <tvrolyk at mlhg dot net> wrote in message
news:(E-Mail Removed)...
> Any reason a make table query that will run succesfully when
> double-clicked will generate a 3061 too few parameters error?
>
> The thing that gets me is that this has been working for ages and I just
> made a very minor tweak in the query and suddenly it stopped working. I
> can run it manually by double-clicking but when I run it from code I get
> that error.
>
> Here is what I am doing
>
> Dim db As DAO.Database
> Set db = CurrentDb()
> db.Execute "qry_Participants_NWExportMakeTable"
>
> Pretty smiple. The query does reference a form for its criteria. The form
> is open and the field referenced has data (A date in this case). this is
> really buggin me. any ideas?
>
> Tony
>


 
Reply With Quote
 
Tony Vrolyk
Guest
Posts: n/a
 
      20th Apr 2006
So why has it worked all this time? That part of the query that I recently
changed is not the part that references the form. I just added an additional
field from the table. And isn't that negated since I am referencing a named
query rather than using a sql string variable?

I wlll follow your advice though. I can change this by moving it to a string
variable and in setting that variable reference the form field so that it is
entered as a value as you suggest.

BTW this is Access 2002.

Tony



"Alex Dybenko" <(E-Mail Removed)> wrote in message
news:%231l%(E-Mail Removed)...
> Hi,
> db.Execute does not evaluate form references. so you have to either
> replace reference to form's parameter with actual value (by modifying SQL
> for example) or use docmd.openquery
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://alexdyb.blogspot.com
> http://www.PointLtd.com
>
> "Tony Vrolyk" <tvrolyk at mlhg dot net> wrote in message
> news:(E-Mail Removed)...
>> Any reason a make table query that will run succesfully when
>> double-clicked will generate a 3061 too few parameters error?
>>
>> The thing that gets me is that this has been working for ages and I just
>> made a very minor tweak in the query and suddenly it stopped working. I
>> can run it manually by double-clicking but when I run it from code I get
>> that error.
>>
>> Here is what I am doing
>>
>> Dim db As DAO.Database
>> Set db = CurrentDb()
>> db.Execute "qry_Participants_NWExportMakeTable"
>>
>> Pretty smiple. The query does reference a form for its criteria. The form
>> is open and the field referenced has data (A date in this case). this is
>> really buggin me. any ideas?
>>
>> Tony
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Too few paramters GLT Microsoft Access Queries 9 10th Feb 2010 01:47 PM
Using SP with paramters as recordsource Jonathan Blitz Microsoft Access Reports 1 26th Sep 2005 03:45 AM
Using SP with paramters as recordsource Jonathan Blitz Microsoft Access Reports 0 23rd Sep 2005 04:32 PM
Dialing in with paramters =?Utf-8?B?RG9yYQ==?= Microsoft Dot NET Framework 0 25th May 2004 06:51 AM
Parsing paramters Mark Microsoft Excel Programming 3 9th Feb 2004 05:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:37 PM.