A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

I need a Form button to open and pass two variable values to a re



 
 
Thread Tools Display Modes
  #1  
Old November 21st, 2009, 01:51 PM posted to microsoft.public.access.forms
Parish Pete[_2_]
external usenet poster
 
Posts: 26
Default I need a Form button to open and pass two variable values to a re

Some while ago I set up a form with 7 buttons, each opening an individual
report based on an individual query.

Essentially the reports & queries are identical except for their title and
data from two table fields.

Since the form buttons determine which report I want to view, it would seem
sensible for each button to pass a different value for a common variable to a
single report. In turn the report can call a single query to extract the
right data from table.

The variable only needs values of 1 to 7. I need then to draw 1 of 7 report
titles from a table and identify to the query that along with data fields
common to all 7 reports it should include one particular pair of fields from
7 pairs.

I can't seem to get the variable recognised within the 'On Click' button
event procedure. Perhaps i'ts the wrong place or the wrong code!

The pairs of data fields in both query and report are called "AC1IN"
AC1OUT", "AC2IN" etc. I need to be able to insert my variable value between
"AC" and" IN" (or OUT) to establish the correct field name in order for it to
work.

Any help would be most welcome

Pete
  #2  
Old November 21st, 2009, 01:57 PM posted to microsoft.public.access.forms
Ken Snell
external usenet poster
 
Posts: 177
Default I need a Form button to open and pass two variable values to a re

If you're using ACCESS 2002 or a later version, you can use the OpenArgs
argument of the OpenReport method to pass a value to the report, and then
read the OpenArgs property in the report's Open event procedure.
--

Ken Snell
http://www.accessmvp.com/KDSnell/



"Parish Pete" wrote in message
...
Some while ago I set up a form with 7 buttons, each opening an individual
report based on an individual query.

Essentially the reports & queries are identical except for their title and
data from two table fields.

Since the form buttons determine which report I want to view, it would
seem
sensible for each button to pass a different value for a common variable
to a
single report. In turn the report can call a single query to extract the
right data from table.

The variable only needs values of 1 to 7. I need then to draw 1 of 7
report
titles from a table and identify to the query that along with data fields
common to all 7 reports it should include one particular pair of fields
from
7 pairs.

I can't seem to get the variable recognised within the 'On Click' button
event procedure. Perhaps i'ts the wrong place or the wrong code!

The pairs of data fields in both query and report are called "AC1IN"
AC1OUT", "AC2IN" etc. I need to be able to insert my variable value
between
"AC" and" IN" (or OUT) to establish the correct field name in order for it
to
work.

Any help would be most welcome

Pete



  #3  
Old November 22nd, 2009, 11:07 PM posted to microsoft.public.access.forms
Parish Pete[_2_]
external usenet poster
 
Posts: 26
Default I need a Form button to open and pass two variable values to a

Thank you Ken, I'll try and get my head round OpenArgs

Let's hope I don't turn it into Open AAArghs!

regards

Pete

"Ken Snell" wrote:

If you're using ACCESS 2002 or a later version, you can use the OpenArgs
argument of the OpenReport method to pass a value to the report, and then
read the OpenArgs property in the report's Open event procedure.
--

Ken Snell
http://www.accessmvp.com/KDSnell/



"Parish Pete" wrote in message
...
Some while ago I set up a form with 7 buttons, each opening an individual
report based on an individual query.

Essentially the reports & queries are identical except for their title and
data from two table fields.

Since the form buttons determine which report I want to view, it would
seem
sensible for each button to pass a different value for a common variable
to a
single report. In turn the report can call a single query to extract the
right data from table.

The variable only needs values of 1 to 7. I need then to draw 1 of 7
report
titles from a table and identify to the query that along with data fields
common to all 7 reports it should include one particular pair of fields
from
7 pairs.

I can't seem to get the variable recognised within the 'On Click' button
event procedure. Perhaps i'ts the wrong place or the wrong code!

The pairs of data fields in both query and report are called "AC1IN"
AC1OUT", "AC2IN" etc. I need to be able to insert my variable value
between
"AC" and" IN" (or OUT) to establish the correct field name in order for it
to
work.

Any help would be most welcome

Pete



.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.