D
D
Hi:
With Steve help I got this code to work yesterday and today not!?; is asking
to install a printer on th output line!
Any idea is greatly appreciated,
Thanks,
Dan
Private Sub Command26_Click()
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim BaseSQL As String
Dim strSQL As String
Set rst = CurrentDb.OpenRecordset("SELECT DISTINCT natl_str_nbr FROM
[mcdeal pilot all days]", dbOpenDynaset, dbReadOnly)
Set qdf = CurrentDb.QueryDefs("[mcdeal all]")
BaseSQL = Left(qdf.SQL, Len(qdf.SQL) - 3)
With rst
Do Until .EOF
strSQL = BaseSQL & " WHERE natl_str_nbr=" & ![natl_str_nbr]
qdf.SQL = strSQL
DoCmd.OutputTo acOutputReport, "mcdeal all stores all days",
"SnapshotFormat", "C:\Documents and Settings\dpopescu\Desktop\test\" &
![natl_str_nbr] & ".snp"
.MoveNext
Loop
.Close
End With
qdf.SQL = BaseSQL
Set qdf = Nothing
Set rst = Nothing
End Sub
With Steve help I got this code to work yesterday and today not!?; is asking
to install a printer on th output line!
Any idea is greatly appreciated,
Thanks,
Dan
Private Sub Command26_Click()
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim BaseSQL As String
Dim strSQL As String
Set rst = CurrentDb.OpenRecordset("SELECT DISTINCT natl_str_nbr FROM
[mcdeal pilot all days]", dbOpenDynaset, dbReadOnly)
Set qdf = CurrentDb.QueryDefs("[mcdeal all]")
BaseSQL = Left(qdf.SQL, Len(qdf.SQL) - 3)
With rst
Do Until .EOF
strSQL = BaseSQL & " WHERE natl_str_nbr=" & ![natl_str_nbr]
qdf.SQL = strSQL
DoCmd.OutputTo acOutputReport, "mcdeal all stores all days",
"SnapshotFormat", "C:\Documents and Settings\dpopescu\Desktop\test\" &
![natl_str_nbr] & ".snp"
.MoveNext
Loop
.Close
End With
qdf.SQL = BaseSQL
Set qdf = Nothing
Set rst = Nothing
End Sub