G
Guest
I have a form with a print preview button (and print for that matter). when
a user clicks on the button, a report is to be previewed (printed) that
contains the information displayed. (taken from a field, CoilID) i've done
in the past some VBA where is make a string that contains the SQL statement
to select the proper record, but i forgot how. could someone help me out?
here's a bit of what i think.
Dim strRptQry As String
Dim dbsC1894 As Database
Dim rstRPTQRY as Recordset
Dim stDocName As String
strRptQry = "Select...."
strRptQry = strRptQry + "more stuff.."
'end of SQL statment string
Set dbsC1984 = CurrentDb
set rstRPTQRY = dbsC1894.OpenRecordset("qryReport")
rstRPTQRY.Open(srtRptQry)
stDocName = "rptScreen"
DoCmd.OpenReport stDocName, acPreview, ,
something along those lines. any help would be appreciated!
a user clicks on the button, a report is to be previewed (printed) that
contains the information displayed. (taken from a field, CoilID) i've done
in the past some VBA where is make a string that contains the SQL statement
to select the proper record, but i forgot how. could someone help me out?
here's a bit of what i think.
Dim strRptQry As String
Dim dbsC1894 As Database
Dim rstRPTQRY as Recordset
Dim stDocName As String
strRptQry = "Select...."
strRptQry = strRptQry + "more stuff.."
'end of SQL statment string
Set dbsC1984 = CurrentDb
set rstRPTQRY = dbsC1894.OpenRecordset("qryReport")
rstRPTQRY.Open(srtRptQry)
stDocName = "rptScreen"
DoCmd.OpenReport stDocName, acPreview, ,
something along those lines. any help would be appreciated!