R
Ryan
I get this error
Error '3061' Too few parameters. Expected 0
When I run this query.
Private Sub Form_Load()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim i As Integer
Dim j As Integer
Set db = CurrentDb
Set rst = db.OpenRecordset("select * from AllBalancesByFCandDB")
rst.MoveFirst
j = -1
i = 0
For i = 0 To rst.Fields.Count - 1
If rst.Fields(i).Name Like "*FinClass" Then GoTo skip_it
j = j + 1
Select Case j
Case 0
Me.lbl1.Caption = rst.Fields(i).Name
Case 1
Me.lbl2.Caption = rst.Fields(i).Name
End Select
skip_it:
Next i
rst.Close
Set rst = Nothing
End Sub
Here is my select * from AllBalancesByFCandDB if it will help.
PARAMETERS [Forms]![Parameters].[LocationFilter] Text ( 255 ),
[Forms]![Parameters].[StartDateFilter2] Text ( 255 ),
[Forms]![Parameters].[EndDateFilter2] Text ( 255 );
TRANSFORM Sum(AllCharges.BalDue) AS SumOfBalDue
SELECT AllCharges.FinClass, Sum(AllCharges.BalDue) AS [Total Of BalDue]
FROM AllCharges
WHERE (((InStr("," & Forms!Parameters.LocationFilter & ",","," & [db] &
","))>0))
GROUP BY AllCharges.FinClass
ORDER BY AllCharges.FinClass
PIVOT AllCharges.DB;
What am I doing wrong??
Error '3061' Too few parameters. Expected 0
When I run this query.
Private Sub Form_Load()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim i As Integer
Dim j As Integer
Set db = CurrentDb
Set rst = db.OpenRecordset("select * from AllBalancesByFCandDB")
rst.MoveFirst
j = -1
i = 0
For i = 0 To rst.Fields.Count - 1
If rst.Fields(i).Name Like "*FinClass" Then GoTo skip_it
j = j + 1
Select Case j
Case 0
Me.lbl1.Caption = rst.Fields(i).Name
Case 1
Me.lbl2.Caption = rst.Fields(i).Name
End Select
skip_it:
Next i
rst.Close
Set rst = Nothing
End Sub
Here is my select * from AllBalancesByFCandDB if it will help.
PARAMETERS [Forms]![Parameters].[LocationFilter] Text ( 255 ),
[Forms]![Parameters].[StartDateFilter2] Text ( 255 ),
[Forms]![Parameters].[EndDateFilter2] Text ( 255 );
TRANSFORM Sum(AllCharges.BalDue) AS SumOfBalDue
SELECT AllCharges.FinClass, Sum(AllCharges.BalDue) AS [Total Of BalDue]
FROM AllCharges
WHERE (((InStr("," & Forms!Parameters.LocationFilter & ",","," & [db] &
","))>0))
GROUP BY AllCharges.FinClass
ORDER BY AllCharges.FinClass
PIVOT AllCharges.DB;
What am I doing wrong??