By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,561 Members | 3,083 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,561 IT Pros & Developers. It's quick & easy.

How can I access form variables from a report

P: 23
Hi,

I have been using access 2000. I have created a form where I put labels and a button to display report. I have populated the labels of that form by using so many tables and calculations.
The problem here is, I need to display those label values(captions) into my report (with out repeating all the calculations).
Is it possible to get those label controls from the report
(like forms!frmname!label.caption) ??
Can anybody help please.......

Thanks in advance
Jul 20 '07 #1
Share this Question
Share on Google+
2 Replies


hyperpau
Expert 100+
P: 184
Hi,

I have been using access 2000. I have created a form where I put labels and a button to display report. I have populated the labels of that form by using so many tables and calculations.
The problem here is, I need to display those label values(captions) into my report (with out repeating all the calculations).
Is it possible to get those label controls from the report
(like forms!frmname!label.caption) ??
Can anybody help please.......

Thanks in advance
I am not sure you can do that.

You should have added those captions right at the time you created your tables. in this case, if you bind a form or a report to the table, those captions should automatically appear so you no longer have to edit them.

does this make sense to you? i dont know what you mean by calculations since you are talking about labels. and labels are just captions. they cannot have calculated data.
Jul 20 '07 #2

ADezii
Expert 5K+
P: 8,638
Hi,

I have been using access 2000. I have created a form where I put labels and a button to display report. I have populated the labels of that form by using so many tables and calculations.
The problem here is, I need to display those label values(captions) into my report (with out repeating all the calculations).
Is it possible to get those label controls from the report
(like forms!frmname!label.caption) ??
Can anybody help please.......

Thanks in advance
You can access Label Captions on an Open Form from a Report. The following code in a Report's Activate() Event will concatenate (add) the Captions from Label1 and Label2 on Form1, then place the combined Captions in a Label (lblHeader) in the Report's Header:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Activate()
  2.   Me![lblHeader].Caption = Forms!Form1![Label1].Caption & ", " & Forms!Form1![Label2].Caption
  3. End Sub
Jul 20 '07 #3

Post your reply

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