D
Dan
I am hoping for a miracle worker out there. I have spent days trying to
figure out how to use the where clause to print one record for a report. I
can't think of anything else to try. Below was my final attempt.
The report is based on a query from two tables. My first thought was to
change the query, but writing out the SQL does away with the reason for
building a query. You would need to go and change the code every time
something changed about the query. I also looked at using QueryDef, but
this is very slow. Then I discovered that you could do this with a where on
the OpenReport, but I can't make it work.
Dim strRptName As String
Dim strWhere As String
strRptName = "rpt10576"
strWhere = ("LName = ' " & Me!txtLName & " '")
DoCmd.OpenReport strRptName, acViewPreview, , strWhere, acWindowNormal
figure out how to use the where clause to print one record for a report. I
can't think of anything else to try. Below was my final attempt.
The report is based on a query from two tables. My first thought was to
change the query, but writing out the SQL does away with the reason for
building a query. You would need to go and change the code every time
something changed about the query. I also looked at using QueryDef, but
this is very slow. Then I discovered that you could do this with a where on
the OpenReport, but I can't make it work.
Dim strRptName As String
Dim strWhere As String
strRptName = "rpt10576"
strWhere = ("LName = ' " & Me!txtLName & " '")
DoCmd.OpenReport strRptName, acViewPreview, , strWhere, acWindowNormal