D,
Well, it may be applicable to open a recordset listing all the stores
that have data in the report, looping through these records and
exporting each to a separate file, by manipulating the criteria of the
query. For example, let's say your report is based on a query called
StoresData. So your code might look something like this...
Dim rst As DAO.Recordset
Dim qdf As DAO.Querydef
Dim BaseSQL As String
Dim strSQL As String
Set rst = CurrentDb.OpenRecordset("SELECT DISTINCT StoreID FROM
StoresData")
Set qdf = CurrentDb.QueryDefs("StoresData")
BaseSQL = Left(qdf.SQL, Len(qdf.SQL)-3)
With rst
Do Until .EOF
strSQL = BaseSQL & " WHERE StoreID=" & ![StoreID]
qdf.SQL = strSQL
DoCmd.OutputTo acOutputReport, "YourReport", "SnapshotFormat",
![StoreID] & ".snp"
.MoveNext
Loop
.Close
End With
qdf.SQL = BaseSQL
Set qdf = Nothing
Set rst = Nothing
--
Steve Schapel, Microsoft Access MVP
Hi:
Due to Rick I found out how to print a list of many stores from the same
report into a separate pages; now, how I can export/ or e-mail every
page/store separately/ or to a separate fiel?
Thanks a lot,
D