G
Guest
Why do I still get prompted for parameter input when this code is supposed to be passing the values to the underlying query, qryRptWorkshop? Note, frmReportSelector!txtYear contains a textbox for the year (txtYear) and option group for the month (fraMo).
Private Sub Report_Open(Cancel As Integer
Dim db As Database, p1 As Parameter, p2 As Paramete
Dim Xx As Integer, str As String, rpt As Repor
Dim mm As Integer, rsnam As Strin
Dim rs As Recordse
Dim qy As QueryDe
mm = Forms!frmReportSelector!fraMo.Valu
Xx = Forms!frmReportSelector!fraMo.Valu
Select Case X
Case 28, 2
If Forms!frmReportSelector!txtYear = "2004" The
Xx = 2
Els
Xx = 2
End I
Case 1, 4, 6, 9, 1
Xx = 3
Case 3, 5, 7, 8, 10, 1
Xx = 3
End Selec
Set db = CurrentDb(
Set qy = db.QueryDefs!qryRptWorksho
Set p1 = qy.Parameters!pStar
Set p2 = qy.Parameters!pEn
p1.Value = CDate(Format(mm & "/1/" & CLng(Forms!frmReportSelector!txtYear), "short date")
p2.Value = CDate(Format(mm & "/" & Xx & "/" & CLng(Forms!frmReportSelector!txtYear), "short date")
Set rs = qy.OpenRecordse
rs.Requer
rsnam = rs.Nam
Me.RecordSource = rsna
End Su
Private Sub Report_Open(Cancel As Integer
Dim db As Database, p1 As Parameter, p2 As Paramete
Dim Xx As Integer, str As String, rpt As Repor
Dim mm As Integer, rsnam As Strin
Dim rs As Recordse
Dim qy As QueryDe
mm = Forms!frmReportSelector!fraMo.Valu
Xx = Forms!frmReportSelector!fraMo.Valu
Select Case X
Case 28, 2
If Forms!frmReportSelector!txtYear = "2004" The
Xx = 2
Els
Xx = 2
End I
Case 1, 4, 6, 9, 1
Xx = 3
Case 3, 5, 7, 8, 10, 1
Xx = 3
End Selec
Set db = CurrentDb(
Set qy = db.QueryDefs!qryRptWorksho
Set p1 = qy.Parameters!pStar
Set p2 = qy.Parameters!pEn
p1.Value = CDate(Format(mm & "/1/" & CLng(Forms!frmReportSelector!txtYear), "short date")
p2.Value = CDate(Format(mm & "/" & Xx & "/" & CLng(Forms!frmReportSelector!txtYear), "short date")
Set rs = qy.OpenRecordse
rs.Requer
rsnam = rs.Nam
Me.RecordSource = rsna
End Su