G
Guest
hi,
can any1 pls help me.
i have created a combo box and listed all of the letters (reports) that we
send to clients, which until now i have created a cmd button for each
individual report with the linked criteria in a macro.
i though it better to list them, i have coded as follows but when i select a
report it does not filter for the specific client (record) but creates a
letter for each and every client.
what am i doing wrong!!!!
Dim StrCLtr1 As String
Dim strCltr2 As String
Dim strCLtr3 As String
Dim StrCLtr4 As String
Dim strCltr5 As String
Dim strCLtr6 As String
Dim strCLtr7 As String
Dim strLinkCriteria As String
StrCLtr1 = "rptNewBusiness"
strCltr2 = "rptReturnDocs"
strCLtr3 = "rptAcceptanceTerms"
StrCLtr4 = "Print Completion Letter"
stLinkCriteria = "[forms]![case recordsfrm]![casedetailstbl.case ref]="
& Me![case ref]
If Me.cmbSelectLetter = "Initial Contact" Then
DoCmd.OpenReport StrCLtr1, acViewPreview, "rptNewBusiness", , ,
stLinkCriteria
End If
If Me.cmbSelectLetter = "Return Documents" Then
DoCmd.OpenReport strCltr2, acViewPreview, "rptReturnDocs"
DoCmd.OpenReport strCltr2, , , stLinkCriteria
End If
If Me.cmbSelectLetter = "Acceptance Terms " Then
DoCmd.OpenReport strCLtr3, acViewPreview, "rptAcceptanceTerms"
DoCmd.OpenReport strCLtr3, , , stLinkCriteria
End If
If Me.cmbSelectLetter = "Print Completion Letter " Then
DoCmd.OpenReport StrCLtr4, acViewPreview, "rptAcceptanceTerms"
DoCmd.OpenReport StrCLtr4, , , stLinkCriteria
End If
thanks for you help..
can any1 pls help me.
i have created a combo box and listed all of the letters (reports) that we
send to clients, which until now i have created a cmd button for each
individual report with the linked criteria in a macro.
i though it better to list them, i have coded as follows but when i select a
report it does not filter for the specific client (record) but creates a
letter for each and every client.
what am i doing wrong!!!!
Dim StrCLtr1 As String
Dim strCltr2 As String
Dim strCLtr3 As String
Dim StrCLtr4 As String
Dim strCltr5 As String
Dim strCLtr6 As String
Dim strCLtr7 As String
Dim strLinkCriteria As String
StrCLtr1 = "rptNewBusiness"
strCltr2 = "rptReturnDocs"
strCLtr3 = "rptAcceptanceTerms"
StrCLtr4 = "Print Completion Letter"
stLinkCriteria = "[forms]![case recordsfrm]![casedetailstbl.case ref]="
& Me![case ref]
If Me.cmbSelectLetter = "Initial Contact" Then
DoCmd.OpenReport StrCLtr1, acViewPreview, "rptNewBusiness", , ,
stLinkCriteria
End If
If Me.cmbSelectLetter = "Return Documents" Then
DoCmd.OpenReport strCltr2, acViewPreview, "rptReturnDocs"
DoCmd.OpenReport strCltr2, , , stLinkCriteria
End If
If Me.cmbSelectLetter = "Acceptance Terms " Then
DoCmd.OpenReport strCLtr3, acViewPreview, "rptAcceptanceTerms"
DoCmd.OpenReport strCLtr3, , , stLinkCriteria
End If
If Me.cmbSelectLetter = "Print Completion Letter " Then
DoCmd.OpenReport StrCLtr4, acViewPreview, "rptAcceptanceTerms"
DoCmd.OpenReport StrCLtr4, , , stLinkCriteria
End If
thanks for you help..