K
Kelvin Beaton
Hi have a report that is based on this query:
SELECT tbl_ClientRecord.ClientID, tbl_ClientRecord.Address, IIf([city] Is
Null,"",StrConv([City],3) & ", " & StrConv([State],1) & " " & [zip]) AS
CityStateZip, tbl_ClientRecord.PrintTNDenialLetter,
StrConv([BeneficiaryFirstName] & " " & [BeneficiaryLastName],3) AS
BeneficiaryFullName, "Dear Parent or Guardian of " &
(StrConv([BeneficiaryFirstName] & " " & [BeneficiaryLastName],3)) & ":" AS
DearFullName
FROM tbl_ClientRecord INNER JOIN tbl_Beneficiaries ON
tbl_ClientRecord.ClientID = tbl_Beneficiaries.ClientID
WHERE (((tbl_ClientRecord.PrintTNDenialLetter)=Yes))
ORDER BY tbl_ClientRecord.Address;
The report prints find when I want to print based on the query above, but
can I use the same report and print just the current client record?
I thought this code would print the corrent record, but it prints all the
records marked "Yes" as in the query above:
Dim stDocName As String
Dim strWhere As String
stDocName = "rpt_PrintTennCareTermination-Letter"
DoCmd.OpenReport stDocName, acPreview
strWhere = "[ClientID] = " & Me.[ClientID]
DoCmd.OpenReport stDocName, acPreview, "", strWhere
If this code worked it would only work if the records was marked to be
printed... "WHERE (((tbl_ClientRecord.PrintTNDenialLetter)=Yes))"
How can I use one report to print using differents sets of data?
Thanks
Kelvin
SELECT tbl_ClientRecord.ClientID, tbl_ClientRecord.Address, IIf([city] Is
Null,"",StrConv([City],3) & ", " & StrConv([State],1) & " " & [zip]) AS
CityStateZip, tbl_ClientRecord.PrintTNDenialLetter,
StrConv([BeneficiaryFirstName] & " " & [BeneficiaryLastName],3) AS
BeneficiaryFullName, "Dear Parent or Guardian of " &
(StrConv([BeneficiaryFirstName] & " " & [BeneficiaryLastName],3)) & ":" AS
DearFullName
FROM tbl_ClientRecord INNER JOIN tbl_Beneficiaries ON
tbl_ClientRecord.ClientID = tbl_Beneficiaries.ClientID
WHERE (((tbl_ClientRecord.PrintTNDenialLetter)=Yes))
ORDER BY tbl_ClientRecord.Address;
The report prints find when I want to print based on the query above, but
can I use the same report and print just the current client record?
I thought this code would print the corrent record, but it prints all the
records marked "Yes" as in the query above:
Dim stDocName As String
Dim strWhere As String
stDocName = "rpt_PrintTennCareTermination-Letter"
DoCmd.OpenReport stDocName, acPreview
strWhere = "[ClientID] = " & Me.[ClientID]
DoCmd.OpenReport stDocName, acPreview, "", strWhere
If this code worked it would only work if the records was marked to be
printed... "WHERE (((tbl_ClientRecord.PrintTNDenialLetter)=Yes))"
How can I use one report to print using differents sets of data?
Thanks
Kelvin