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????:(
12 1916 NeoPa 32,557
Recognized Expert Moderator MVP
Try adding this line of code to your report's OnOpen event procedure : - Call DoCmd.SelectObject(ObjectType:=acReport, ObjectName:=Me.Name)
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.
can you explain that code to me?
im using the following code for my combobox: - DoCmd.OpenReport "Report2", acPreview, "", "[userID]=[Forms]![comboreport]![Combo0]"
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.
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
my pop up and modal are all set to NO.... - 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
NeoPa 32,557
Recognized Expert Moderator MVP
my pop up and modal are all set to NO.... - 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).
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
this is my last problem..................................
i need help
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.
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: - DoCmd.OpenReport "ReportName", acViewPreview
-
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!
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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...
|
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...
|
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...
|
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...
| |
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"...
|
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...
|
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...
|
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...
|
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. ...
|
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,...
| |
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: 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...
|
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: 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...
|
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |