473,669 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using different reports for different lines of the same query

4 New Member
Hi all.

In my company we have a database to keep record of measuring and control instruments f.e. Pressure switchs, Thermometres, Gauges, etc.

Each type of instrument has a different form because the type of data we keep from them varies depending of how it works. Al these forms have a common part where we put the name of the instrument, the facility, serial number, etc. and a different one with the especific technical data for each instrument. We have a corresponding report for each type of form.

To enter data for a new instrument it's easy, the user just selects the type and then he is showed the right form.

The problem is when I want to print all the instruments data from a certain installation, for example. The query will give me as a result many different instruments. When I print the reports I need to launch a different one depending of the instrument type and here is where I need your help.

How to lauch different reports from a single query depending on the intrument type?

If I didn't explain correctly please let me know and I will try to make it clearer. As you surely have seen english is not my first language. :)

Thanks in advance.
Apr 30 '12 #1
6 1436
NeoPa
32,569 Recognized Expert Moderator MVP
You seem to make fewer errors in your English than many for whom it IS their first language :-D

You do, however, have a pretty complex task in front of you. My advice would be to try to design a report with various controls available. Some fairly complex (although not rocket-science level) code would need to be run at print or format time to ensure that only the controls appropriate for the current object are visible.

Another thought that occurs to me, although I can't promise it will work as it's just a new idea, is to have a subreport control that takes any of the reports designed for your objects and sets the ObjectSource value of the SubReport control to match for each individual object.
Apr 30 '12 #2
Mihail
759 Contributor
Lets see first if I understand well your request:
Expand|Select|Wrap|Line Numbers
  1. For Each Instrument In Query Instruments
  2.     Print the report
  3. Next
Is this what you are looking for ?

If the answer is YES I think that is an easy task:
Also in pseudo-code that must look like:
Expand|Select|Wrap|Line Numbers
  1. Create a recordset based on your query
  2. For Each record in recordset
  3.     Select Case InstrumentType
  4.         Case Thermometre
  5.             DoCmd OpenReportForTermometres Filter:= ThermometreIdentifier
  6.         Case PresureInstrument
  7.             DoCmd OpenReportForPresureInstruments Filter:= PresureInstrumentIdentifier
  8.         Case .........
  9.              DoCmd OpenReport....... Filter:= ...........Identifier
  10.         Case Else
  11.              Some error message
  12.     End Select
  13. Next
May 1 '12 #3
David Scott
4 New Member
Thank you both for your answers.

I think that what I need is exactly what Mihail says, a Select Case that goes through all the instruments launching the right report depending on its type.

The problem is that I'm having trouble implementing it and as I still have very little experience with VBA and SQL I can't find the error.

From what I've found googling this is the way to create a recordset from my query:

Expand|Select|Wrap|Line Numbers
  1. Dim dbCalibraciones As DAO.Database
  2. Dim rstEquipos As DAO.Recordset
  3. Dim strSQL As String
  4.  
  5. Set dbCalibraciones = CurrentDb
  6. Set rstEquipos = dbCalibraciones.OpenRecordset(CON_FICHAS_BLANCO)
CON_FICHAS_BLAN CO is a query that gives me all the instruments from a selected facility.

This returns me the error 3061 saying that they are too few parameters and that 1 was expected.

What i am doing wrong?

Thank you very much for your patience.
May 2 '12 #4
NeoPa
32,569 Recognized Expert Moderator MVP
That may certainly prove an easier approach to get your head around David. I'll continue to follow anyway, in case I can be of further help.
May 2 '12 #5
Mihail
759 Contributor
Sorry but this time my time is very limited.
Try to put CON_FICHAS_BLAN CO between quotes:

"CON_FICHAS_BLA NCO"

If steel don't work inform me and I'll try, tomorrow, to give you more assistance.
May 2 '12 #6
NeoPa
32,569 Recognized Expert Moderator MVP
Mihail:
Try to put CON_FICHAS_BLAN CO between quotes:
That would certainly be necessary David. Otherwise VBA will be looking for a variable called CON_FICHAS_BLAN CO.
May 3 '12 #7

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

Similar topics

2
2313
by: Luis Serrano | last post by:
Hi all, I'm trying to generate labels to print in several different formats, all of them with their own height,width and page margins. We've got this done in MS Access 2000, using a designed report that fits with each label type, and reads a table dinamically generated. But the problem is page margins. Does Access store page margins and information of that kind within de report? Is there any kind of association between printer...
0
1016
by: lra | last post by:
I am exporting my report to an html file using Crystal Reports. I have set the following properties: htmlOpts.HTMLBaseFolderName = @"C:\Temp\"; htmlOpts.HTMLFileName = "MyTest.html"; My file ends up in a temp folder (temp_187cb3f0-60bf-4ea7-a0f7-651a1bb0feb3) which gets created in C:\Temp. Also, it ends up having a .htm extension instead of .html. How can I avoid having this extra folder created and get the correct extension?
1
1363
by: Don Wash | last post by:
Hi All! I'm very very new to DotNet and doing my first Report project. I'm planning of using VS.NET built-in CrystalReports to create reports. I'm probably really navie and ignorant to ask this but here's goes. I want to know if there are any client compatiblity issues need to be considered when utilizing CystalReports chart controls? Does client need to download any controls in order to view the charts properly? Or CystalReports...
0
889
by: Enver A | last post by:
Hi There, I am having difficulties on using Active Reports on vb.net . I have succesfully tried and executed designing and printing a report but what i am trying to do is to design an End-User designer. I can send parameters while i am attaching a reader to the report. But What if a client wnats to design a report on End-User designer. How will i send parameter to it?
0
857
by: mafandon | last post by:
In my windows application, I have a few different reports that are custom. We print the reports to pre-formatted carbon paper. I would like to set the printer for each report so the user doesn't have to find the particular one from a print dialog box. I have come across this very nice command <<rundll32 printui.dll,PrintUIEntry>that would seem to do it, but it's just a matter of specifying the report somehow.
1
5840
by: Venk | last post by:
I want to combine 2 different reports. That is Report 1 should be followed by report 2 If Report 1 is in Page 1, automatically report2 should be in page2 Any thought or help on this would be appreciated. thanks venk
1
2261
by: krupas | last post by:
Hi, I have an ASP.net site in which I am generating reports using Crystal reports for .Net framework 2.0. I want to know if it is possible to change the format of the x axis data values. For example, I am displaying count of employees, month-wise. the x- axis shows months as 7/2006, 8/2006,9/2006........ . This is because my report selection formula selects month(date)., and the dates are in this format in database. However, I wish to display...
0
888
by: kalpanasuresh | last post by:
Hi, I am getting Logon error while using Crstal Reports in ASP.net.pls help Thanks in advance
4
2911
by: GladGad | last post by:
I am not a real well versed query writer and therefore am having some problems figuring out how to write a parameter query where I want to input a partial name. I have tried a few different things, but either get no results or all of the records in BANKS are returned. I am using Access 2000 on XP. I am using three tables for this query: BANKS BankID (pk) BankName Other fields that are not pertinent to this query VENDORS ...
4
4441
by: kv29 | last post by:
Hi everyone! I really hope my problem will be a piece of cake for an expert coder :) I have a table with 100 records, and I need to print them all between 10 different reports based on each record field value, all with a single click. As you guessed, I dont know much about vb, so I would really appreciate some code to do what is required. thanks!
0
8465
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
8895
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
8588
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,...
1
6210
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
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
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.