Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Access Modules daovba ado > can't figure ou...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1467 of 1609
Post > Topic >>

can't figure out 3061 error = too few parameters

by =?Utf-8?B?TWFyaWFuIE0u?= <Marian M.@[EMAIL PROTECTED] > Apr 28, 2008 at 07:32 PM

Error 3061 is keeping my module from running. The module is now an SQL with

two substitutions. I've made it simpler (took out nested loop) & still
can't 
see where the problem is. When I fill in the two 'blanks' and run it as a 
query in Access, I get no error message. I've looked at the code until I'm

crosseyed but nothing pops out at me. I'm hoping that fresher pairs of
eyes 
will see the error(s) that I cannot.

Here is the 'simpler' module code:
----------
Sub CreateHLOffer()

Dim strFiceHLOffering As String, strSQL As String
Dim jLoop As Integer
Dim dbs As Database
Dim rsFiceHLOffering As Recordset

  Set dbs = CurrentDb
      For jLoop = 1 To 18
        Set rsFiceHLOffering = dbs.OpenRecordset("Select FiceHLOffering
From 
tblHLOffering Where ID = " & jLoop)
        strFiceHLOffering = rsFiceHLOffering!FiceHLOffering ' Set the
first 
Fice HLOffering string
        strSQL = "UPDATE [LSAYCombinedCollegeVars-24Apr08-MLM] LEFT JOIN 
[LSAYFice-CollLvl-25Apr08-MLM]"
        strSQL = strSQL & " ON
[LSAYCombinedCollegeVars-24Apr08-MLM].[r62a1]"
        strSQL = strSQL & " = [LSAYFice-CollLvl-25Apr08-MLM].[UNITID]"
        strSQL = strSQL & " SET 
[LSAYCombinedCollegeVars-24Apr08-MLM].[hloffer61]"
        strSQL = strSQL & " = [LSAYFice-CollLvl-25Apr08-MLM].[" & 
strFiceHLOffering & "]"
        strSQL = strSQL & " WHERE 
(([LSAYCombinedCollegeVars-24Apr08-MLM].[r61])=" & jLoop & ");"
       dbs.Execute strSQL
      Next jLoop

End Sub
----------

Here is the query the should be created when jLoop = 11 (& that works just

fine as an Access query) (I just picked 11 at random for this example. It
has 
no special meaning)
----------
UPDATE [LSAYCombinedCollegeVars-24Apr08-MLM] LEFT JOIN 
[LSAYFice-CollLvl-25Apr08-MLM] ON 
[LSAYCombinedCollegeVars-24Apr08-MLM].[R62A1] = 
[LSAYFice-CollLvl-25Apr08-MLM].[UNITID] SET 
[LSAYCombinedCollegeVars-24Apr08-MLM].[hloffer61] = 
[LSAYFice-CollLvl-25Apr08-MLM].[hloffer97_11]
WHERE (([LSAYCombinedCollegeVars-24Apr08-MLM].[r61])=11);
----------

Here is the error message:
----------
Too few parameters. Expected <number>. (Error 3061) 

This parameter query requires the specified number of parameters, which
you 
did not supply. Provide the expected number of parameters, and run the
query 
again.

In some cases, this message is generated when unknown field names or 
expressions are interpreted as query parameters. Be sure to enclose field 
names containing spaces or punctuation with square brackets [ ].
----------

TIA,
Marian
 




 1 Posts in Topic:
can't figure out 3061 error = too few parameters
=?Utf-8?B?TWFyaWFuIE0u?=   2008-04-28 19:32:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 15:51:36 CST 2008.