473,473 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

New report in loop

77 New Member
Hi all,
I have a loop and my report open code is in this loop.How can I make access to open new report for each item in the loop when I run it?
My code:
Expand|Select|Wrap|Line Numbers
  1.  Dim rs As New ADODB.Recordset
  2.     Dim strSql As String
  3.  
  4.    strSql = "SELECT DISTINCT tbl_Report.ReportMonth, tbl_Customer_Interest.CustomerID FROM tbl_Customer_Interest INNER JOIN tbl_Report ON tbl_Customer_Interest.ReportID = tbl_Report.ReportID WHERE (((tbl_Report.ReportMonth)='" & Me!cboMonth.Value & "'));"
  5.  
  6.     rs.Open strSql, CurrentProject.Connection
  7.  
  8.             If rs.EOF Then
  9.             MsgBox ("This month does not have any record.")
  10.             Exit Sub
  11.             End If
  12.  
  13.     Do While Not rs.EOF
  14.      stOpenDate = "(QryRptCustomer.ReportMonth)='" & cboMonth.Value & "' and (QryRptCustomer.CustomerId)=" & rs!CustomerId & ""
  15.      DoCmd.OpenReport stDocName, acViewPreview, , stOpenDate
  16.       rs.MoveNext
  17.     Loop
  18.  
Oct 15 '08 #1
0 1010

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Jim Fox | last post by:
I have a report that I created that has no data, just boxes, lines and one date field not tied to anything. Basically this report will just print pages according to the dates you entered. Then...
1
by: Phil Stanton | last post by:
I am trying to create a text box in Word the same height as one on a report and then fill it with text. I can "read" the position of the text box from the report OK and create a text box in Word...
2
by: Bob Quintal | last post by:
I have a report that prints a single record. Normally it's enter one record, then print it. This works great. New requirement: Each record needs to be printed to an individual ..pdf file from...
0
by: bill mahoney | last post by:
I have access 2k and I have 2 tables. One is a 7X6 table representing a month with zeroes padding the fields where no day exist. For example February 2003 0 0 0 0 0 0 1 2 3 4 5 6 7 ...
3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
1
by: steven | last post by:
I am creating some financial reports in Access 2000, and I am having problem that I can't resolve. The report sorts information first by vendor, then by budget line number. It generates the...
1
by: tonyaccess | last post by:
Hi, I hope you may be able to help a coding novice. I have a fairly simple db which extracts data to a report via a query, my problem is the report is three pages per record set and a total of...
2
by: Serge Fournier | last post by:
Hello everyone. How to give the connexion information to a crystal report at run time ? same question concerning the SQL string for data extraction ? Is it "a must" to disconnect the report at...
1
by: Brad | last post by:
Thanks for taking the time to read my question. I have a table of data that has Date, Data and Category. I need to show, in a report, each Categories Data by Date. The Date has to be it's own...
3
by: jambonjamasb | last post by:
Hi I have two tables: email_tbl Data_table Data table is is used to create a Form Data_form
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.