tgleghorn58
Registered User.
- Local time
- Yesterday, 21:42
- Joined
- Sep 9, 2014
- Messages
- 26
I have parameter form that ask for state and begining date. on click it runs a query and creates a report by state that has multiple pages.. I want to create a separate pdf file for is page (which would be by delegate_name).
This is the coding I have so far and am gettting the error '424' object required. This is the coding I currently have. I haven't worked with access in over 9 yrs so am a little rusty with it. I may be way off on this coding so any help would be appreciate.
StateAbb = Me.State
PeriodStartDate = Format(Me.Period_start_date, "MM-DD-YYYY")
Dim strSQL As String
Dim db As Database
Dim rs As Recordset
Dim strRptName As String
Dim strDelegate As String
strSQL = "PARAMETERS [Forms]![frm_parameters_by_state]![Period_start_date] DateTime, [Forms]![frm_parameters_by_state]![State] Text ( 255 );" & _
"SELECT Credentialing_wc.Period_Start_Date, Credentialing_wc.Period_End_Date, Credentialing_wc.Delegate_Name, Credentialing_wc.Effective_Date_of_Credentialing_Delegation_for_WellCare, " & _
"Credentialing_wc.Do_you_sub_delegate_any_part_of_Credentialing , Credentialing_wc.Are_you_or_your_sub_delegate_Accredited, Credentialing_wc.Do_you_use_a_Credentialing_Verification_Organization, " & _
"Credentialing_wc.Is_CVO_accredited , Credentialing_wc.What_Network_Type_or_Services_do_you_provide, Credentialing_wc.Did_WellCare_conduct_a_Pre_delegation_Audit_during_prior_six_mth, " & _
"Credentialing_wc.Was_a_Pre_delegation_Corrective_Action_Plan_issued, Credentialing_wc.Did_WellCare_conduct_an_Annual_Audit_during_the_prior_six_mths, Credentialing_wc.Was_an_Annual_Audit_Corrective_Action_Plan_issued, " & _
"Credentialing_wc.How_many_providers_were_Initial_Credentialed_for_WellCare_during, Credentialing_wc.[How_many_providers_were_Re_credentialed_for_WellCare _during_pri], " & _
"Credentialing_wc.Is_your_recredentialing_cycle_2_or_3_years, Credentialing_wc.Did_all_providers_Recredentialed_during_the_prior_six_mths_meet_ , " & _
"Credentialing_wc.How_many_WellCare_providers_were_identified_as_sanctioned_by_OIG, Credentialing_wc.How_many_WellCare_providers_termed_without_cause_during_prior_si, " & _
"Credentialing_wc.How_many_WellCare_providers_were_termed_With_cause_during_prior_, Credentialing_wc.If_termed_with_cause_what_was_the_reason, Credentialing_wc.[Lines_of_Business_(per_State)_(up_to_20_words)], " & _
"Credentialing_wc.reviewed_date, Credentialing_wc.reviewed_by, Credentialing_wc.[comment_section_(up_to_75_words)], qry_Omni_Flow_cnt.State, qry_Omni_Flow_cnt.NEW, qry_Omni_Flow_cnt.TERM, qry_Omni_Flow_cnt.Update " & _
"FROM Credentialing_wc LEFT JOIN qry_Omni_Flow_cnt ON (Credentialing_wc.Period_Start_Date = qry_Omni_Flow_cnt.From) AND (Credentialing_wc.Delegate_Name = qry_Omni_Flow_cnt.EntityName) AND (Credentialing_wc.State = qry_Omni_Flow_cnt.State) " & _
"WHERE (((Credentialing_wc.Period_start_date) =" & [Forms]![frm_parameters_by_state]![Period_start_date] And (qry_Omni_Flow_cnt.State) = [Forms]![frm_parameters_by_state]![State] And (Credentialing_wc.State) = [Forms]![frm_parameters_by_state]![State] & "))" & _
"ORDER BY Credentialing_wc.Delegate_Name;"
strRptName = "rpt_Credentialing_by_state"
Set db = CurrentDb
Debug.Print strSQL
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
Do While Not rs.EOF
DoCmd.OpenReport strRptName, acViewPreview, , "[Delegate_Name] = " & rs![Delegate_Name]
rptName = Path & "Credentialing_Report_" & removeSpecial(StateAbb) & "_" & rs!Delegate_Name & PeriodStartDate
DoCmd.OutputTo acOutputReport, "Rpt_Credentialing_by_state", "PDFFormat(*.pdf)", rptName, True, "", , acExportQualityPrint
DoCmd.Close acReport, "rpt_Credentialing_by_state", acSaveNo
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set db = Nothing
Beep
MsgBox """Credentialing report has been exported successfully.""", vbOKOnly, ""
End Sub
This is the coding I have so far and am gettting the error '424' object required. This is the coding I currently have. I haven't worked with access in over 9 yrs so am a little rusty with it. I may be way off on this coding so any help would be appreciate.
StateAbb = Me.State
PeriodStartDate = Format(Me.Period_start_date, "MM-DD-YYYY")
Dim strSQL As String
Dim db As Database
Dim rs As Recordset
Dim strRptName As String
Dim strDelegate As String
strSQL = "PARAMETERS [Forms]![frm_parameters_by_state]![Period_start_date] DateTime, [Forms]![frm_parameters_by_state]![State] Text ( 255 );" & _
"SELECT Credentialing_wc.Period_Start_Date, Credentialing_wc.Period_End_Date, Credentialing_wc.Delegate_Name, Credentialing_wc.Effective_Date_of_Credentialing_Delegation_for_WellCare, " & _
"Credentialing_wc.Do_you_sub_delegate_any_part_of_Credentialing , Credentialing_wc.Are_you_or_your_sub_delegate_Accredited, Credentialing_wc.Do_you_use_a_Credentialing_Verification_Organization, " & _
"Credentialing_wc.Is_CVO_accredited , Credentialing_wc.What_Network_Type_or_Services_do_you_provide, Credentialing_wc.Did_WellCare_conduct_a_Pre_delegation_Audit_during_prior_six_mth, " & _
"Credentialing_wc.Was_a_Pre_delegation_Corrective_Action_Plan_issued, Credentialing_wc.Did_WellCare_conduct_an_Annual_Audit_during_the_prior_six_mths, Credentialing_wc.Was_an_Annual_Audit_Corrective_Action_Plan_issued, " & _
"Credentialing_wc.How_many_providers_were_Initial_Credentialed_for_WellCare_during, Credentialing_wc.[How_many_providers_were_Re_credentialed_for_WellCare _during_pri], " & _
"Credentialing_wc.Is_your_recredentialing_cycle_2_or_3_years, Credentialing_wc.Did_all_providers_Recredentialed_during_the_prior_six_mths_meet_ , " & _
"Credentialing_wc.How_many_WellCare_providers_were_identified_as_sanctioned_by_OIG, Credentialing_wc.How_many_WellCare_providers_termed_without_cause_during_prior_si, " & _
"Credentialing_wc.How_many_WellCare_providers_were_termed_With_cause_during_prior_, Credentialing_wc.If_termed_with_cause_what_was_the_reason, Credentialing_wc.[Lines_of_Business_(per_State)_(up_to_20_words)], " & _
"Credentialing_wc.reviewed_date, Credentialing_wc.reviewed_by, Credentialing_wc.[comment_section_(up_to_75_words)], qry_Omni_Flow_cnt.State, qry_Omni_Flow_cnt.NEW, qry_Omni_Flow_cnt.TERM, qry_Omni_Flow_cnt.Update " & _
"FROM Credentialing_wc LEFT JOIN qry_Omni_Flow_cnt ON (Credentialing_wc.Period_Start_Date = qry_Omni_Flow_cnt.From) AND (Credentialing_wc.Delegate_Name = qry_Omni_Flow_cnt.EntityName) AND (Credentialing_wc.State = qry_Omni_Flow_cnt.State) " & _
"WHERE (((Credentialing_wc.Period_start_date) =" & [Forms]![frm_parameters_by_state]![Period_start_date] And (qry_Omni_Flow_cnt.State) = [Forms]![frm_parameters_by_state]![State] And (Credentialing_wc.State) = [Forms]![frm_parameters_by_state]![State] & "))" & _
"ORDER BY Credentialing_wc.Delegate_Name;"
strRptName = "rpt_Credentialing_by_state"
Set db = CurrentDb
Debug.Print strSQL
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
Do While Not rs.EOF
DoCmd.OpenReport strRptName, acViewPreview, , "[Delegate_Name] = " & rs![Delegate_Name]
rptName = Path & "Credentialing_Report_" & removeSpecial(StateAbb) & "_" & rs!Delegate_Name & PeriodStartDate
DoCmd.OutputTo acOutputReport, "Rpt_Credentialing_by_state", "PDFFormat(*.pdf)", rptName, True, "", , acExportQualityPrint
DoCmd.Close acReport, "rpt_Credentialing_by_state", acSaveNo
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set db = Nothing
Beep
MsgBox """Credentialing report has been exported successfully.""", vbOKOnly, ""
End Sub