473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Which form opened this report?

218 Expert 100+
Hi,

Being very dumb today!

I need to know, in VBA code, which form was used to call a report (using DoCmd.OpenReport)

Must be some sort of method or property to do this???

TIA

Steve
Jan 11 '07 #1
4 1277
ADezii
8,834 Expert 8TB
Hi,

Being very dumb today!

I need to know, in VBA code, which form was used to call a report (using DoCmd.OpenReport)

Must be some sort of method or property to do this???

TIA

Steve
Use the OpenArgs Property of the OpenReport Method as in:
Expand|Select|Wrap|Line Numbers
  1. Dim stDocName As String
  2.  
  3. stDocName = "rptEmployee"
  4. DoCmd.OpenReport stDocName, acPreview, , , acWindowNormal, "My Form Name"
Then, in the Report's Open() Event, place code similiar to this. This should point you in the right direction.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2. If Not IsNull(Me.OpenArgs) Then
  3.   MsgBox "Form " & Me.OpenArgs & " opened this Report"
  4. End If
  5. End Sub
Jan 11 '07 #2
cyberdwarf
218 Expert 100+
Hi, ADezii


Thx for your response.

Unfortunately, the OpenArgs property is already in use for other purposes ;-(

Ho hum

Steve
Jan 11 '07 #3
ADezii
8,834 Expert 8TB
Hi, ADezii


Thx for your response.

Unfortunately, the OpenArgs property is already in use for other purposes ;-(

Ho hum

Steve
How about assigning a Public Variable representing the Form's Name when it is opened. It can then be read anywhere within the Project?
Jan 11 '07 #4
NeoPa
32,556 Expert Mod 16PB
I don't think there is a prescribed way to do this I'm afraid Cyber.
ADezii's idea is probably the best you'll get.
Jan 12 '07 #5

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

Similar topics

2
by: endran | last post by:
Hi Friends how to stop reopen form which already opened. for example my form code is like this every time when i click opening the form i want to stop that please help M.A.Endran Private...
3
by: Simone | last post by:
Hi, I'm a DB newbie and I've been having issues trying to print the record I am viewing in a form to a report. I have looked in groups all over and they all say to try basically the same thing...
11
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together...
0
by: Maileen | last post by:
Hi, I have a VB.NET application which includes several forms. however,i need to know which form is opened and visible, like that i can actualize it. (typically dynamic changes of language...
2
by: MLH | last post by:
A97 Am having difficulty displaying graph in Form View that I see fine in graph control on form opened in design view. I know I'm doing something wrong. If I open the form in design view - I...
6
by: shyam | last post by:
Hi All I had raised a simillar query in an earlier post ...
4
by: sara | last post by:
Hi - I've looked at many posts, and cannot find the answer on this specific problem. I have several fields on a table, which I've defined as "Text", 3 characters, Format Yes/No (I picked up the...
6
by: sarahaman | last post by:
hi all i am new in oracle! i made one simple form with report and i made one print button with trigger.(when-button-pressed) when i press the print button so its giving me whole data,i do not...
14
by: eneyardi | last post by:
I can't see the layout view of the form anymore, i tried to look-up the report format but the allow layout view is selected as yes. But the Design and Print view of the report are available. Anyone...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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
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
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...

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.