Rabu, 24 Februari 2016

RE: [MS_AccessPros] Need help with a Report


Hi Duane!


Thanks so much for your reply.  Please know that I am a novice when it comes to coding, so your help is greatly appreciated!!  I put in the code you gave me for my "View Report" button...here is the code for the button:


Private Sub Command93_Click()

Dim strReport As String

Select Case Me.RptOpt
    Case Is = 1
        strReport = "R_TrainingHistConfig"
        DoCmd.RunMacro "TrainingHistConfig"
    Case Is = 2
        strReport = "R_TrnTrxnClassRoster"
        DoCmd.RunMacro "TrnClassRpt"
    Case Is = 3
        strReport = "R_TrainingClassDetail4DateRange"
        DoCmd.RunMacro "TrainingbyDateRanges"
    Case Is = 4
        strReport = "Report all Active Emp"
    Case Is = 5
        strReport = "R_Active Emp By Dept"
    Case Is = 6
        strReport = "R_TrnTrxnScheduleDateRange"
        DoCmd.RunMacro "TrainingScheduleDateRange"
    Case Is = 7
        strReport = "R_TrnTrxnClassRosterDateRange"
        DoCmd.RunMacro "TrainingClassRosterDateRange"
    Case Is = 8
        Dim strWhere As String
        strWhere = "1=1 "
        If Not IsNull(Me.Name) Then
        strWhere = strWhere & " AND [Name] = """ & Me.Name & """ "
    End If
        If Not IsNull(Me.CDesc) Then
        strWhere = strWhere & " AND [CDesc] = """ & Me.CDesc & """ "
    End If
        '  add more controls and where conditions
        strReport = "R_TrnHist4SpecificEmp"
        DoCmd.OpenReport "R_TrnHist4SpecificEmp", acViewPreview, , strWhere
End Select

DoCmd.Close acForm, "f_ConfigRpts"
DoCmd.OpenReport strReport, acViewPreview

End Sub



When I select an employee name and a class description, and select the training history for specific employee option button, and click on the view report button, a "Enter Parameter Value" for the CDesc comes up.  I've check the labels for my combo box on the form, and the text box on the report, and they are corrent.  I'm not sure what I'm doing wrong.


Thanks so much for your help!



Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)



Tidak ada komentar:

Posting Komentar