Hello,
My company has Refund form that was originally created using Access 98. We are on 2002 now. Here's the scenario currently. If a refund should go to the patient then a Patient Letter needs to print. If refund goes to a Third Party Insurance Company, an Insurance letter (form) should print. With both forms, a Cover Sheet (indicating Reason for refund) will print - all based on information the user puts in the main Refund form as well as him checking the chkbx Patient or Insurance Company. Right now there's a print button (see code below) that will print the letters and cover sheet based on the current record - but only one at a time. Can anyone give me information on how to set this up so that users will be able to print a range of records based on the auto generated Record Number? I tried creating 3 queries: qryCoverSheet, qryPatientLetter, qryInsuranceLetter, and put between [] and [] expression based on RecordNumber then altered the below code to exclude the Me!RecordNumber and stLinkCriteria, and when I tried to print the range, only the Patient Letter printed but all the Cover Sheets printed and NOT the insurance letters. I know this is long, but any help is really appreciated as I am truly a novice.
'Prints Cover sheet and Cover Letters for Ins and Pat
Dim stDocName As String
Dim MyForm As Form
Dim stLinkCriteria As String
Dim stDocName2 As String
Dim stLinkCriteria2 As String
If RefundToPatient = -1 Then
stDocName = "frmPatientLetter"
stDocName2 = "frmCover Sheet"
stLinkCriteria2 = "[RecordNumber]=" & Me![RecordNumber]
stLinkCriteria = "[RecordNumber]=" & Me![RecordNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.PrintOut acSelection 'Print Current page
DoCmd.Close acForm, stDocName
'Open and Print Cover Sheet
DoCmd.OpenForm stDocName2, , , stLinkCriteria2
DoCmd.PrintOut acSelection
DoCmd.Close acForm, stDocName2
ElseIf RefundToThirdParty = -1 Then
stDocName = "frmInsuranceLetter"
stDocName2 = "frmCover Sheet"
stLinkCriteria2 = "[RecordNumber]=" & Me![RecordNumber]
stLinkCriteria = "[RecordNumber]=" & Me![RecordNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.PrintOut acSelection
DoCmd.Close acForm, stDocName
'Print Cover Sheet for Insurance Letter
DoCmd.OpenForm stDocName2, , , stLinkCriteria2
DoCmd.PrintOut acSelection
DoCmd.Close acForm, stDocName2
Else: MsgBox ("Please Select Patient or Company")
End If
My company has Refund form that was originally created using Access 98. We are on 2002 now. Here's the scenario currently. If a refund should go to the patient then a Patient Letter needs to print. If refund goes to a Third Party Insurance Company, an Insurance letter (form) should print. With both forms, a Cover Sheet (indicating Reason for refund) will print - all based on information the user puts in the main Refund form as well as him checking the chkbx Patient or Insurance Company. Right now there's a print button (see code below) that will print the letters and cover sheet based on the current record - but only one at a time. Can anyone give me information on how to set this up so that users will be able to print a range of records based on the auto generated Record Number? I tried creating 3 queries: qryCoverSheet, qryPatientLetter, qryInsuranceLetter, and put between [] and [] expression based on RecordNumber then altered the below code to exclude the Me!RecordNumber and stLinkCriteria, and when I tried to print the range, only the Patient Letter printed but all the Cover Sheets printed and NOT the insurance letters. I know this is long, but any help is really appreciated as I am truly a novice.
'Prints Cover sheet and Cover Letters for Ins and Pat
Dim stDocName As String
Dim MyForm As Form
Dim stLinkCriteria As String
Dim stDocName2 As String
Dim stLinkCriteria2 As String
If RefundToPatient = -1 Then
stDocName = "frmPatientLetter"
stDocName2 = "frmCover Sheet"
stLinkCriteria2 = "[RecordNumber]=" & Me![RecordNumber]
stLinkCriteria = "[RecordNumber]=" & Me![RecordNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.PrintOut acSelection 'Print Current page
DoCmd.Close acForm, stDocName
'Open and Print Cover Sheet
DoCmd.OpenForm stDocName2, , , stLinkCriteria2
DoCmd.PrintOut acSelection
DoCmd.Close acForm, stDocName2
ElseIf RefundToThirdParty = -1 Then
stDocName = "frmInsuranceLetter"
stDocName2 = "frmCover Sheet"
stLinkCriteria2 = "[RecordNumber]=" & Me![RecordNumber]
stLinkCriteria = "[RecordNumber]=" & Me![RecordNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.PrintOut acSelection
DoCmd.Close acForm, stDocName
'Print Cover Sheet for Insurance Letter
DoCmd.OpenForm stDocName2, , , stLinkCriteria2
DoCmd.PrintOut acSelection
DoCmd.Close acForm, stDocName2
Else: MsgBox ("Please Select Patient or Company")
End If