473,785 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Preview multiple instances of dynamically altered report

3 New Member
Hi, all!

I have a report with quite a few fields that are hidden and moved depending on if they are tracked by the user or not. The report is previewing and printing just fine. However, my user wants to be able to open the same report in preview mode for multiple wells selected from a list box. So, one report might have 20 fields visible, and the next might only have 15 fields visible. I can get it to print one right after the other, but it will only preview the last one selected. Any ideas on how I can get the report to preview one right after the other?

Any help is appreciated!

Thanks,
Brandi
Jun 17 '10 #1
6 2969
jimatqsi
1,277 Recognized Expert Top Contributor
Please show us the code you are using to launch the report(s) now. That way we'll have a common starting point for discussion.

Thanks,
Jim
Jun 17 '10 #2
bgremill
3 New Member
I have a form where the user selects the desired report and enters any criteria into text boxes or selects from combo/list boxes. There is code that gets the name of the report and a function that creates the where clause. Here's the basic code for printing the report:

'Print a separate report for each Well
Set db = CurrentDb
Set qdf = db.QueryDefs("q ryWells") ‘Active WellIDs
strSQL = qdf.SQL

Set rst = db.OpenRecordse t(strSQL, dbOpenDynaset)

strNewWhere = ""

With rst
If .RecordCount <> 0 Then
.MoveFirst
Do Until .EOF
strNewWhere = strWhere & " AND WellID = " & !WellID
DoCmd.OpenRepor t strDocName, lngView, , strNewWhere
.MoveNext
Loop
End If
End With

Set qdf = Nothing
Set rst = Nothing
Set db = Nothing

Where:
strDocName = “rptWellLog”
strWhere = "ReadDate Between #5/1/10# And #5/9/10#"
lngView = 0 ‘Print

Thanks!
Jun 17 '10 #3
jimatqsi
1,277 Recognized Expert Top Contributor
Shouldn't lngview be acPreview if you want to preview these reports? I don't see lngview being set, so I don't understand why they don't all behave the same way.

Jim
Jun 17 '10 #4
bgremill
3 New Member
@jimatqsi
This is all in a function, and when I call the function, I pass it lngView. It prints each one fine, but only previews the last one. I think it opens each one, but the user only sees the last one because each time it opens a new one, it replaces the one before it. Somehow I'm going to have to dynamically create a copy of the original report for each well and open each one right after each other. Does that make sense?
Jun 18 '10 #5
jimatqsi
1,277 Recognized Expert Top Contributor
You could go right to .pdf files and specify they should be opened. That would do it, but it's not really a preview.
Jun 18 '10 #6
FishVal
2,653 Recognized Expert Specialist
You may instantiate the same report class (Reprt_<report name>) as multiple instances via global object variables.

Example:

Expand|Select|Wrap|Line Numbers
  1. Dim col As New VBA.Collection
  2.  
  3.  
  4. Private Sub btn_Click()
  5.  
  6.     Dim rpt As Report_rpt
  7.     Set rpt = New Report_rpt
  8.     rpt.Visible = True
  9.     col.Add rpt
  10.  
  11. End Sub
  12.  
  13.  
Jun 21 '10 #7

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

Similar topics

1
4100
by: Bruce | last post by:
I am writing an installer that needs to put a dll file with a bunch of extended stored procedures in the BINN directory. The problem is that if the machine is running multiple instances of SQL Server, there is more than one BINN directory. The installer has a dynamically populated dropdown with the name of the instances, so does anyone know if this logic is correct and/or reliable assuming SQL Server 2000? If the instance name =...
2
2096
by: (Pete Cresswell) | last post by:
I have a situation where a bunch of statistics are being presented based on a mutual fund and a benchmark fund's monthly and quarterly returns for a given period (like 10 years....) The hitch is that all bets are off if all four return streams are not complete and contiguous. In that case, however, the user needs to know which fund(s) have returns missing for which dates so they can backfill them. I started out with a single report...
3
7699
by: sara | last post by:
I've been reading all the posts on this topic. Most are years old, so I have 2 questions: 1. Is there any improvement on opening the same report multiple times (with different input parameters on each) with Access 2000? 2. In the post listed below (from March 1998) M G Foster posed a solution that makes sense to me and looks like something I could learn. HOWEVER, the code snippet refers to getting the input parameters from a list...
6
2659
by: Bob Alston | last post by:
Looking for someone with experience building apps with multiple instances of forms open. I am building an app for a nonprofit organizations case workers. They provide services to the elderly. so far I have built a traditional app, switchboard, forms, etc. Part of this app is to automate the forms they previously prepared manually. After the app was built and works just fine, I find out there are several case managers using MS word...
6
6918
by: Bugs | last post by:
Does anyone have any recommendations on the best way to create multiple instances of the same class when the final number of instances is unknown? For example, I have a class and based on some user actions, I want to create n number instances of those classes, which is obviously unknown at compile time. What is the easiest way to create and then manage these kinds of objects? Using an array seems intuitive but it also seems like it...
6
1823
by: Savante | last post by:
I have been writing a datalogging application. It reads in double's into a database. I want to be able to click on a row in a database (holds name of variable and also current value of variable) and then instantiate a new form. I created a new form form2 and then just on double click on a button.... dim form as new form2 form.show
4
2691
by: nottarealaddress | last post by:
I'm trying to get my feet wet in VB2005 (our new standard at work after officially stopping new development in VB6 about a month ago). I'm working with a simple sql 2005 table of 50 entries, one for each state. Each entry contains Name, postal abbreviation, etc. Just simple stuff to understand the mechanisms, syntax, etc. I'm now to the point where I've got a Master MDI form that opens one or more types of forms, I'm able to edit/save...
2
1657
LegalIT
by: LegalIT | last post by:
Hello, I have a VB.net application that creates reports from database information. I am able to create the reports fine. The problem is each time I create a report my application starts a new instance of Word instead of just adding a document to the current application. I use the following code to create each report. If I take the New out I get an error. Dim objWord As New Word.Application objWord.Visible = True ...
1
2230
by: manontheedge | last post by:
I'm trying to create multiple instances of a class dynamically. For example ... Class A { ... ... };
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9484
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10350
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10097
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9957
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8983
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.