67flyer
Registered User.
- Local time
- Today, 07:13
- Joined
- Jul 29, 2006
- Messages
- 49
I am getting an run time error 3061, too few parameters. expected 1 when i try to open the report. If i use this code: Set rsHR = Cdb.OpenRecordset("Select Count([HRID])as HR from qryrptflighthr WHERE PID = 'ae5698'"
the report will open but if using the code below i get the error. The me!pid equals ae5698.
Thanks for the Help.
--------------------
Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
Dim Cdb As DAO.Database
Dim rsHR As DAO.Recordset
'Rest the row counter
bRowCounter = 0
'Get the count of the max rows that have values
Set Cdb = CurrentDb
Set rsHR = Cdb.OpenRecordset("Select Count([HRID])as HR from qryrptflighthr WHERE PID = " & Me!PID)
bHRcount = Nz(rsHR!HR)
rsHR.Close
Set rsHR = Nothing
Set Cdb = Nothing
'Reset all controls to display in black for the first Record
Me!NSN.ForeColor = COLOR_BLACK
Me!ITEM.ForeColor = COLOR_BLACK
Me.ui.ForeColor = COLOR_BLACK
End Sub
the report will open but if using the code below i get the error. The me!pid equals ae5698.
Thanks for the Help.
--------------------
Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
Dim Cdb As DAO.Database
Dim rsHR As DAO.Recordset
'Rest the row counter
bRowCounter = 0
'Get the count of the max rows that have values
Set Cdb = CurrentDb
Set rsHR = Cdb.OpenRecordset("Select Count([HRID])as HR from qryrptflighthr WHERE PID = " & Me!PID)
bHRcount = Nz(rsHR!HR)
rsHR.Close
Set rsHR = Nothing
Set Cdb = Nothing
'Reset all controls to display in black for the first Record
Me!NSN.ForeColor = COLOR_BLACK
Me!ITEM.ForeColor = COLOR_BLACK
Me.ui.ForeColor = COLOR_BLACK
End Sub