Hi All,
I've got a Recordset that stores a summary (no duplicates) of a field in a query.
This particulary field gives the index for the query/report that needs to be called, ie:
1. I have a number of records that are of interest (pulled from the dB from a query)
2. Each record in dB has a type, this type is the trigger for the query/report that needs to be run for it
3. There are 16 types
4. The recordset may not contain all 16 types.
5. I created a summary of which types are in the recordset
6. I only want to call the relevant query/reports
7. I have done this with a case statement
The issue is where the call is made to open the query and then open the report(in printpreview), I ony get the first 2 records from the query appearing in the report:
iDisplayType = 2
.
.
.
.
.
Case Is = 17
DoCmd.OpenQuery ("17 - General AO")
DoCmd.OpenReport "17 - General AO", iDisplayType
Can someone please let me know what is going on and why I'm only getting the first 2 elements
7 1376
I have just subscribed to this thread
We need to see the query.
SQL of parent Query:
SELECT CommRefQuery.InstallCompl, CommRefQuery.CommDocCirc, CommRefQuery.CommComplete, CommRefQuery.CommisioningItem, CommRefQuery.PTermR, CommRefQuery.ExtTag, CommRefQuery.SectInd1, CommRefQuery.[Comm Sht Ind], CommRefQuery.Type, CommRefQuery.Description, CommRefQuery.InstallComplDate, CommRefQuery.MechFICReq, CommRefQuery.MechFICPerformed, CommRefQuery.CommDocCirc, CommRefQuery.CommDocCircTo, CommRefQuery.CommDocCircDate, CommRefQuery.CommDocRcv, CommRefQuery.CommDocRcvDate, CommRefQuery.CommCompleteDate, CommRefQuery.Cabinet
FROM CommRefQuery
WHERE (((CommRefQuery.CommDocCirc)<>Yes));
SQL of query who's report is only printing 2 records:
SELECT CommChkShtGenQuery.ExtTag, CommChkShtGenQuery.PTermR, CommChkShtGenQuery.[Comm Sht Ind], CommChkShtGenQuery.Description, CommChkShtGenQuery.Type, CommChkShtGenQuery.Cabinet
FROM CommChkShtGenQuery
WHERE (((CommChkShtGenQuery.[Comm Sht Ind])="19"));
All queries of this nature have the same error (the only difference is the [Comm Sht Ind] value they are pulling out.
If you need more info, please let me know.
Regards
Darryl
I Should also mention that if I step through the code line, by line there is no problem, but if I run straight past the OpenReport line, then there is a problem.
I have no idea what is going on.
I were using a proper language, I'd compare the machine code from both the debug and non-debug compiles and see what's going on, but being a relative VBA noob, I'm more than a little stuck.
Regards
Darryl
Is there a reason you open the query before opening the report? Unless it's an action query, there's no need to open it.
I open the query so that I can double check that everything has worked properly, it the number of sheets in the print-preview matched the record count.
I don't see how me opening the query prior to the report would change the fact that I only get 2 of the records when not debugging the code.
Regards
Darryl
It could cause a lock on the records if both are attempting to access the same resource at the same time.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jason |
last post by:
I have a table of 650,000 records associated to contracts. Some of
the contracts have multiple records but each contract only has one
Active Record (there might be several inactive records). ...
|
by: John M |
last post by:
Hi,
I have two incomplete lists of staff which combined create a full list of
staff with duplicates. I wish to create a full list with no duplicates.
Each member of staff has and obviously a...
|
by: Chuck Reed |
last post by:
I have a MS Access data base that creates custom reports for clients
in PDF form then prints the reports after all client's reports have
been printed. The problem that I have run into is that when...
|
by: thesonofdad |
last post by:
Hi all,
Fun problem for everyone over the weekend - :)
OK so I have the following SQL query in Access.....
SELECT x.SURVEY_DATE AS , z.ORIG_CONST_DATE, z.ORIG_EXP_NO
FROM . AS x, . AS z;
...
|
by: Certys |
last post by:
Hello,
I have a form where I only allow new records to be added. I enable
this by setting the form property "Data Entry" to Yes.
I want to access other records in the same table- to autofill...
|
by: HansyW |
last post by:
Please help
I m reading data and need to output to a file. For each record, I have a header and several details records. I need the header to be on one line, all the details on another line , and...
|
by: Nathan Sokalski |
last post by:
I want to select only the first n records from a database using VB.NET. I
have declared a DataTable and OleDB.OleDbDataAdapter as follows:
Dim linkstable As New DataTable
Dim linksadapter As New...
|
by: kdubble |
last post by:
Hi
I am trying to get the results of a query to show only unique student
records (not duplicates). Is there a simple way to make the criteria
field do this? I am not too familiar with SQL.
...
|
by: G33W1zz |
last post by:
Hi,
I'm trying to use foreach to write the results of a query to a csv file (fputcsv is not an option as my server is on php 4.7.4).
Problem is that the second foreach returns ONLY the first...
|
by: Omendra |
last post by:
Hi,I am creating my SP as dynamic,
On that i am defining varchar(max) to need to get more than 8000 characters.
But my SP is taken only 8000 characters when i am doing Print to my SP.
Please...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
|
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,...
|
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...
| |