Okay...here goes...
Thanks, Mile-O. A couple of things you should know.
First, the query results contain records for all the countries in our database. Secondly, the recordset contains multiple records for each country. For instance, there is a record for popluation and another record for GDP and another record for number of airports, etc. What I need the code to do is create a report for a the first country...then go on to the next country and create a new report and so on, using the country name (Entity) as part of the file name.
What I am getting right now is several large reports...for each country that contain data for all the countries. In other words it is not distinguishing between the countries...just dumping all the data into each report created.
Private Sub Command0_Click()
Dim db as DAO.Database
Dim rec as DAO.Recordset
Dim geoID As String
Dim strPathCountry As String
Set db = CurrentDb()
Set rec = db.OpenRecordset("QUERYcr")
Do While Not rec.EOF
geoID = rec.Fields("GEOCODE")
strPathCountry = "U:\COUNTRY_REPORTS\" & rec.Fields("Entity") & ".rtf"
DoCmd.OuptputTo acOutputReport, "COUNTRY_REPORT", acFormatRTF, strPathCountry
rec.MoveNext
Loop
rec.Close
set db = Nothing
set rec = Nothing
End Sub