473,769 Members | 6,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Runtime error 3061

I am using a database that has worked for many years for a holiday
project for needy families. My organization recently upgraded its
server and changed everyone to Windows XP. I just mention that in case
that has anything to do with the problem.

There are pre-set reports that can be run with this database. I am
getting a Runtime Error 3061 with one of them. It says Too Few
Parameters. Expected 1.

I have tried to trouble-shoot, but am not knowledgable enough in the
back-end of databases to figure it out, and my tech resource locally
hasn't responded to a call for help. Can anyone out there offer any
advice?! Thanks so much in advance.

Following is the line of code that the debugger highlights:

Set rst = db.OpenRecordse t("qryChildrenC ounts", dbOpenDynaset) ' Create
dynaset.
rst.MoveFirst
Here is all of the code that the debugger shows me:
Private Sub Detail1_Print(C ancel As Integer, PrintCount As Integer)
Dim rst As Recordset
Dim db As Database
Dim intLocation As Integer
Dim intFamilyLocati on As Integer
Dim varSex As Variant
Dim intUnder3Stuart F As Integer
Dim intUnder3Stuart M As Integer
Dim int35StuartF As Integer
Dim int35StuartM As Integer
Dim int68StuartF As Integer
Dim int68StuartM As Integer
Dim int912StuartF As Integer
Dim int912StuartM As Integer
Dim int13StuartF As Integer
Dim int13StuartM As Integer

Dim intUnder3NoneF As Integer
Dim intUnder3NoneM As Integer
Dim int35NoneF As Integer
Dim int35NoneM As Integer
Dim int68NoneF As Integer
Dim int68NoneM As Integer
Dim int912NoneF As Integer
Dim int912NoneM As Integer
Dim int13NoneF As Integer
Dim int13NoneM As Integer

Dim intUnder3Indian townF As Integer
Dim intUnder3Indian townM As Integer
Dim int35Indiantown F As Integer
Dim int35Indiantown M As Integer
Dim int68Indiantown F As Integer
Dim int68Indiantown M As Integer
Dim int912Indiantow nF As Integer
Dim int912Indiantow nM As Integer
Dim int13Indiantown F As Integer
Dim int13Indiantown M As Integer

intUnder3NoneF = 0
intUnder3NoneM = 0
int35NoneF = 0
int35NoneM = 0
int68NoneF = 0
int68NoneM = 0
int912NoneF = 0
int912NoneM = 0
int13NoneF = 0
int13NoneM = 0

intUnder3Stuart F = 0
intUnder3Stuart M = 0
int35StuartF = 0
int35StuartM = 0
int68StuartF = 0
int68StuartM = 0
int912StuartF = 0
int912StuartM = 0
int13StuartF = 0
int13StuartM = 0

intUnder3Indian townF = 0
intUnder3Indian townM = 0
int35Indiantown F = 0
int35Indiantown M = 0
int68Indiantown F = 0
int68Indiantown M = 0
int912Indiantow nF = 0
int912Indiantow nM = 0
int13Indiantown F = 0
int13Indiantown M = 0

Set db = CurrentDb()
Set rst = db.OpenRecordse t("qryChildrenC ounts", dbOpenDynaset) '
Create dynaset.
rst.MoveFirst
Do While Not rst.EOF
intLocation = NullToZero(rst! fldDispositon)
intFamilyLocati on = NullToZero(rst! fldFamilyLocati on)
varSex = rst!fldSex
'Debug.Print intLocation; varSex
Select Case varSex
Case "F"
Select Case intLocation ' Agency Recommendation
Case 0
Select Case intFamilyLocati on 'Family Location
Case 2
intUnder3Indian townF =
intUnder3Indian townF + rst![Under 3]
int35Indiantown F = int35Indiantown F +
rst![3-5]
int68Indiantown F = int68Indiantown F +
rst![6-8]
int912Indiantow nF = int912Indiantow nF +
rst![9-12]
int13Indiantown F = int13Indiantown F +
rst![13+]
Case Else
intUnder3Stuart F = intUnder3Stuart F +
rst![Under 3]
int35StuartF = int35StuartF + rst![3-5]
int68StuartF = int68StuartF + rst![6-8]
int912StuartF = int912StuartF +
rst![9-12]
int13StuartF = int13StuartF + rst![13+]
End Select
'intUnder3NoneF = intUnder3NoneF + rst![Under
3]
'int35NoneF = int35NoneF + rst![3-5]
'int68NoneF = int68NoneF + rst![6-8]
'int912NoneF = int912NoneF + rst![9-12]
'int13NoneF = int13NoneF + rst![13+]
Case 1, 3
intUnder3Stuart F = intUnder3Stuart F +
rst![Under 3]
int35StuartF = int35StuartF + rst![3-5]
int68StuartF = int68StuartF + rst![6-8]
int912StuartF = int912StuartF + rst![9-12]
int13StuartF = int13StuartF + rst![13+]

Case 2
intUnder3Indian townF = intUnder3Indian townF +
rst![Under 3]
int35Indiantown F = int35Indiantown F + rst![3-5]
int68Indiantown F = int68Indiantown F + rst![6-8]
int912Indiantow nF = int912Indiantow nF +
rst![9-12]
int13Indiantown F = int13Indiantown F + rst![13+]
End Select
Case "M"
Select Case intLocation
Case 0
Select Case intFamilyLocati on
Case 2
intUnder3Indian townM =
intUnder3Indian townM + rst![Under 3]
int35Indiantown M = int35Indiantown M +
rst![3-5]
int68Indiantown M = int68Indiantown M +
rst![6-8]
int912Indiantow nM = int912Indiantow nM +
rst![9-12]
int13Indiantown M = int13Indiantown M +
rst![13+]
Case Else
intUnder3Stuart M = intUnder3Stuart M +
rst![Under 3]
int35StuartM = int35StuartM + rst![3-5]
int68StuartM = int68StuartM + rst![6-8]
int912StuartM = int912StuartM +
rst![9-12]
int13StuartM = int13StuartM + rst![13+]
End Select

'intUnder3NoneM = intUnder3NoneM + rst![Under
3]
'int35NoneM = int35NoneM + rst![3-5]
'int68NoneM = int68NoneM + rst![6-8]
'int912NoneM = int912NoneM + rst![9-12]
'int13NoneM = int13NoneM + rst![13+]

Case 1, 3
intUnder3Stuart M = intUnder3Stuart M +
rst![Under 3]
int35StuartM = int35StuartM + rst![3-5]
int68StuartM = int68StuartM + rst![6-8]
int912StuartM = int912StuartM + rst![9-12]
int13StuartM = int13StuartM + rst![13+]
Case 2
intUnder3Indian townM = intUnder3Indian townM +
rst![Under 3]
int35Indiantown M = int35Indiantown M + rst![3-5]
int68Indiantown M = int68Indiantown M + rst![6-8]
int912Indiantow nM = int912Indiantow nM +
rst![9-12]
int13Indiantown M = int13Indiantown M + rst![13+]
End Select
End Select
rst.MoveNext
Loop
rst.Close
'Me!txtUnder3No neM = intUnder3NoneM
'Me!txtUnder3No neF = intUnder3NoneF
'Me!txt35NoneM = int35NoneM
'Me!txt35NoneF = int35NoneF
'Me!txt68NoneF = int68NoneF
'Me!txt68NoneM = int68NoneM
'Me!txt912NoneF = int912NoneF
'Me!txt912NoneM = int912NoneM
'Me!txt13NoneF = int13NoneF
'Me!txt13NoneM = int13NoneM

Me!txtUnder3Stu artM = intUnder3Stuart M
Me!txtUnder3Stu artF = intUnder3Stuart F
Me!txt35StuartM = int35StuartM
Me!txt35StuartF = int35StuartF
Me!txt68StuartF = int68StuartF
Me!txt68StuartM = int68StuartM
Me!txt912Stuart F = int912StuartF
Me!txt912Stuart M = int912StuartM
Me!txt13StuartF = int13StuartF
Me!txt13StuartM = int13StuartM

Me!txtUnder3Ind iantownM = intUnder3Indian townM
Me!txtUnder3Ind iantownF = intUnder3Indian townF
Me!txt35Indiant ownM = int35Indiantown M
Me!txt35Indiant ownF = int35Indiantown F
Me!txt68Indiant ownF = int68Indiantown F
Me!txt68Indiant ownM = int68Indiantown M
Me!txt912Indian townF = int912Indiantow nF
Me!txt912Indian townM = int912Indiantow nM
Me!txt13Indiant ownF = int13Indiantown F
Me!txt13Indiant ownM = int13Indiantown M

End Sub

Nov 13 '05 #1
2 5939
fa********@yaho o.com wrote:
Dim db As Database


Try changing this to

Dim db As DAO.Database

and make sure you have the latest DAO library reference selected in the
module preferences.

There are other things to be aware of and action when converting A97 to
A2k3 - look here <http://members.iinet.net.au/~allenbrowne/ser-
48.html#convers ion>

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #2
I'm guessing that qryChildrenCoun ts contains a reference such as:
[Forms].[Form1].[Text1]

That won't work for an OpenRecordset, because the Expression Service is not
available to resolve the reference in this context. You can set the
Parameter of the QueryDef in code, but it's generally easier to just use a
SQL statement as a string in VBA, concatenating the value from the text box
into the string.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<fa********@yah oo.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I am using a database that has worked for many years for a holiday
project for needy families. My organization recently upgraded its
server and changed everyone to Windows XP. I just mention that in case
that has anything to do with the problem.

There are pre-set reports that can be run with this database. I am
getting a Runtime Error 3061 with one of them. It says Too Few
Parameters. Expected 1.

I have tried to trouble-shoot, but am not knowledgable enough in the
back-end of databases to figure it out, and my tech resource locally
hasn't responded to a call for help. Can anyone out there offer any
advice?! Thanks so much in advance.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3314
by: Miranda Evans | last post by:
I noticed several postings about issues related to "run-time error 3061", and I observed that the solutions to these issues appear to involve correcting something within the SQL code. I'm encountering the "run-time error 3061" issue, but I'm not sure how to go about correcting the SQL. My hunch is that I have not properly constructed things to identify a date field, but I don't know how to correct this issue. In addition to not...
3
4019
by: colm | last post by:
i get the above runtime error on the following line of code when i try to update a reord in my form when it gets to the line Set rs = DBEngine(0)(0).OpenRecordset(strSql) the entire code is posted below
2
5545
by: Steve Richfield | last post by:
There have been LOTS of postings about error 3061, but mine seems to be an even simpler case than the others. I have a simple **FUNCTIONING** query called qryEdits. Copying the SQL from the query, it reads: SELECT Edits.Pattern, Edits.From, Edits.To FROM Edits WHERE (((Edits.Language)=!.)); The idea is to select just the language-appropriate records from the
4
7164
by: Richard Hollenbeck | last post by:
I thought I was very specific in this SQL request. There is a form open with a selected record (and a corresponding "lngRecipeID" on that form. The table also has a field called "lngRecipeID". But I keep getting this error: Runtime Error 3061: Too Few Parameters expected 1. What should I be looking for to fix this? Here's my code so far: Private Sub cmdAddIngredientToRecipe_Click() Dim dbGetRecipeID As DAO.Database
1
22305
by: Richard Hollenbeck | last post by:
I wonder what I'm missing? I really feel like a retard because I've been screwing with some code for a very long time. I just must be missing something very simple. In the following example, I've stripped away everything that doesn't cause the error to make my question a little simpler. Here's the problem in its simplest form inside a report: Dim db As DAO.Database
3
2550
by: ragtopcaddy via AccessMonster.com | last post by:
I have an error handler: On Error GoTo Outtahere At the end of the routine, the OuttaHere section reads: OuttaHere: If Err.Number <0 Then If Err.Number = 3061 Then Debug.Print " Failed to get " & strFileName & " data" Err.Clear GoTo NextFile 'most likely, the spreadsheet lacks the lowUtilizationANDMemory field
1
1517
atksamy
by: atksamy | last post by:
i have the following code On Error GoTo TableTest_Error Set rs3 = CurrentDb.OpenRecordset(strsql3) GoTo continue TableTest_Error:
3
4386
by: phill86 | last post by:
Hi, I am trying to run the following query in a recordset and i get the following error message Runtime error 3061 - Too few parameters. Expected 1 i am using the following code
8
2992
Cintury
by: Cintury | last post by:
The problem is I have a function that I've created and stored in a module. I call it as an expression (e.g. total: Function(parameter)). I'm receiving the error 3061: too few parameters, expected 1. Now the query and database are already open so I'm not entirely sure of any connection strings I may need. I think part of the problem may be that the parameter I am using to call the function is part of the query. I am not sure how to come by this...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.