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