PC Review


Reply
Thread Tools Rate Thread

Accessing calling Form value

 
 
=?Utf-8?B?UiBXZXN0b24=?=
Guest
Posts: n/a
 
      30th Jun 2004
I wanted to know:

If i've got a button (in a form) which when clicked, runs a report, but this report can be 'called' from other Forms,
How do I in the report, access values from a calling Form without directly using the form name (because that will change)?

I tried Form.Parent![variable], but that i think only works for Subforms.

-TIA
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      30th Jun 2004
If you are using Access 2002 or 2003, you could use the OpenArgs of
OpenReport to pass the name of the calling form:
DoCmd.OpenReport "MyReport", acViewPreview, OpenArgs:= Me.Name

In earlier verisons, Dim a public string variable in a general module, set
it to the name of your form before using OpenReport, and then you can read
the value and clear it in Report_Open or wherever.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"R Weston" <(E-Mail Removed)> wrote in message
news:F64767D1-FF38-49F5-880D-(E-Mail Removed)...
> I wanted to know:
>
> If i've got a button (in a form) which when clicked, runs a report, but

this report can be 'called' from other Forms,
> How do I in the report, access values from a calling Form without directly

using the form name (because that will change)?
>
> I tried Form.Parent![variable], but that i think only works for Subforms.
>
> -TIA



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accessing a value of a user control from the calling page evandelagrammaticas@hotmail.com Microsoft ASP .NET 6 19th Mar 2006 11:55 PM
accessing db without calling a function? Sean Microsoft ADO .NET 1 9th Jun 2004 04:44 AM
Repost: label not showing up in form when calling form from other form using .Show() Steve Sargent Microsoft Dot NET Framework Forms 4 5th Mar 2004 01:46 PM
Calling a form function from a button click on a user defined control placed on the form Scott Schade Microsoft C# .NET 3 20th Feb 2004 01:16 AM
Accessing control on calling page John Knoop Microsoft ASP .NET 3 19th Jul 2003 05:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:15 PM.