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.
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.
Lets see first if I understand well your request: - For Each Instrument In Query Instruments
-
Print the report
-
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: - Create a recordset based on your query
-
For Each record in recordset
-
Select Case InstrumentType
-
Case Thermometre
-
DoCmd OpenReportForTermometres Filter:= ThermometreIdentifier
-
Case PresureInstrument
-
DoCmd OpenReportForPresureInstruments Filter:= PresureInstrumentIdentifier
-
Case .........
-
DoCmd OpenReport....... Filter:= ...........Identifier
-
Case Else
-
Some error message
-
End Select
-
Next
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: - Dim dbCalibraciones As DAO.Database
-
Dim rstEquipos As DAO.Recordset
-
Dim strSQL As String
-
-
Set dbCalibraciones = CurrentDb
-
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.
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.
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.
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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?
|
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...
|
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?
|
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.
| |
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
|
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...
|
by: kalpanasuresh |
last post by:
Hi,
I am getting Logon error while using Crstal Reports in ASP.net.pls help
Thanks in advance
|
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
...
|
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!
|
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...
| |
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...
|
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,...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |