473,507 Members | 5,257 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Report Opening

173 New Member
hi,

i have a form that has two buttons......................

one button opens a form with a combobox.............. this combobox has a list of usernames(from the table)........ When selecting a username, it brings up a report with the users details.

the other button opens a report of all users...........

THE PROBLEM that i have is... when it opens the report whether from the combobox or directly from a button..... the report is displayed behind the all the forms.. i have to close down the forms to view the report...........y is that?

and also if i select from the combobox, i must close down the combobox screen to actually view or access the report????:(
Dec 11 '06 #1
12 1916
NeoPa
32,557 Recognized Expert Moderator MVP
Try adding this line of code to your report's OnOpen event procedure :
Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.SelectObject(ObjectType:=acReport, ObjectName:=Me.Name)
Dec 11 '06 #2
NeoPa
32,557 Recognized Expert Moderator MVP
If that doesn't help you must have some code in your project (running after the report is displayed) that selects the form again and brings it to the front.
Dec 11 '06 #3
Beany
173 New Member
can you explain that code to me?

im using the following code for my combobox:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "Report2", acPreview, "", "[userID]=[Forms]![comboreport]![Combo0]"
Dec 11 '06 #4
NeoPa
32,557 Recognized Expert Moderator MVP
Not much to explain really.
It selects the report object and brings it to the front of the window.
Dec 11 '06 #5
MMcCarthy
14,534 Recognized Expert Moderator MVP
At a guess I would say you have the Modal property on your forms set to yes.

Mary
Dec 11 '06 #6
Beany
173 New Member
my pop up and modal are all set to NO....


Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.SelectObject(ObjectType:=acReport, ObjectName:=Me.Name) 
In ObjectName:=Me.Name, do i change Me.Name to my report name?

my report is called Report2
Dec 12 '06 #7
NeoPa
32,557 Recognized Expert Moderator MVP
my pop up and modal are all set to NO....


Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.SelectObject(ObjectType:=acReport, ObjectName:=Me.Name) 
In ObjectName:=Me.Name, do i change Me.Name to my report name?

my report is called Report2
No, that's exactly as it needs to be.
I'm not hopeful it will work, but it can't do any harm testing.
Me.Name means get the name for the object I'm in (code-wise).
Dec 12 '06 #8
Beany
173 New Member
sorry it didnt work im getting the following error message:

Run-time error '2530':

The SelectObject method can't be used on a report that is currently printing
Dec 12 '06 #9
Beany
173 New Member
this is my last problem..................................

i need help
Dec 12 '06 #10
NeoPa
32,557 Recognized Expert Moderator MVP
this is my last problem..................................

i need help
See post #3 Beany. I suspect this is where we've got to on this.
We cannot tell you what you may or may not have in your current code.
This is something you'll have to find for yourself I'm afraid.
Dec 12 '06 #11
twinnyfo
3,653 Recognized Expert Moderator Specialist
Beany,

I used that same code on reports for months and then Access all of a sudden decided to start giving me the same error you described. Here is the solution:

From the parent form that calls your report:

Expand|Select|Wrap|Line Numbers
  1.     DoCmd.OpenReport "ReportName", acViewPreview
  2.     DoCmd.SelectObject acReport, "ReportName"
For some reason, this allows the report to complete its opening procedures and then allows you to select it. It should come to the front (if all your other forms' modal and popup properties are set to no.

Even if those forms are set to modal, you can add a few lines of code to your form to set modal to false, then open the report. Then, in the OnClose event of your report, reset the modal porperty on your forms to true.

Good luck!
Nov 16 '11 #12
NeoPa
32,557 Recognized Expert Moderator MVP
Beany:
Run-time error '2530':

The SelectObject method can't be used on a report that is currently printing
Wow. This thread is from my first month of involvement with Bytes (or TheScripts as it was called then).

@Twinnyfo
If you look back through the thread you'll see that your (very sensible) suggestion has already been posted, but to no avail (See quoted post for reported results of that).

Now I go through it again all this time later, I notice that this error message indicates that the report is not being opened as one would suspect (and as Twinnyfo had it) with the acViewPreview parameter value, but clearly it must have used the default of acNormal instead, which causes the report to print directly to the printer instead of to show on the screen. This is the cause of the problem, but as the OP (Beany) posted the question so poorly (without including any hint of their code) that never came to light before.
Nov 16 '11 #13

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

Similar topics

2
2755
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...
2
5431
by: CSDunn | last post by:
Hello, I have an Access 2003 report that opens in print preview and then maximizes upon clicking a button from a form. The OnClick event of the button fires a macro to open the report. How can...
1
1784
by: prabhukalyan | last post by:
Hi all, I am not so good in queries. here is my problem 2 tables to store the received items (fabric)-- inwardmaster, inwarddetails and after some processing (Dyeing) the items were...
1
2445
by: rxfrenc | last post by:
Hello, I am trying to create a report that displays balance impacting inventory transactions. I can easily pull the current on-hand balance in one query and the transaction history in another...
2
6765
by: Prakash | last post by:
I have 2 tables ... Customer_Master: Cust-Code, Cust_Name Customer_Transactions: Cust_Code, Date, Details, Debit, Credit I would like to generate a report in the foll manner, say from...
28
1902
by: ryanhokanson | last post by:
I was just trying to get a list of all my reports along with their widths. I can't use the "Reports" collection because it only works on open reports. So I tried looking into the "AllReports"...
7
2914
by: martin DH | last post by:
Hello, I have a report that I open that pull its data from a form that builds a where string. Opening the report first opens the form, where I enter criteria, and then pulls matching records from a...
11
7294
by: Gord | last post by:
When I open a certain report, it runs some code that generates the records that will be displayed in that report. This works fine. When I go to print preview the report it appears that the code...
3
2066
by: Naushad | last post by:
Hi All, I am trying to open the report conditionally from the dialogue box form. In the form there are three field. cboEmployees StartDate EndDate I have used these field in criteria to...
10
9096
by: Snoopy33 | last post by:
I have a DB that I developed on access XP (2002) and deployed over a year ago. No one has had problems printing any of the reports within the DB until we started loading 2007 on new computers. ...
0
7313
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,...
0
7372
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
7029
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
7481
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
5619
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,...
0
4702
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1537
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 ...
1
758
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.