grab data displayed in the form and pass them to the report.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can you please show me how to grab data that displayed in the form and when
the user clicks on a button on that form, those data will be sent to display
on the REPORT in a text box, for example, ="Your grade is " & [Grade] & "."
([Grade] is on the form)
Thank you,
 
Can you please show me how to grab data that displayed in the form and when
the user clicks on a button on that form, those data will be sent to display
on the REPORT in a text box, for example, ="Your grade is " & [Grade] & "."
([Grade] is on the form)
Thank you,

In an unbound control in the report:

="Your grade is " & forms!FormName![Grade] & "."

The form must be open when the report is run.
 
Hi fredg:
Thank you for your help. I tried your way and it did show up the data.
However, I would like to see all other records on the form to show up on the
report.
For example, I have two textboxes in the report's detail section. The first
textboxes has the value ="Your grade is " & [Grade] & " and your rank is " &
[Rank] & "." and the second has almost the same values as the first one plus
a little more different values.

Assume I get two records from the record source of the form. The first
record has the empty RANK value, but the second record has the RANK value is,
say, 4. When I clicked on the button to show up the report, the first textbox
on the report shows the value of the first record correctly, but the second
textbox show empty values for both [GRADE] and [RANK]???

I suspect that the code just works for the first record. Am I right? If so,
what can I do to make all data show up?
Thank you,



fredg said:
Can you please show me how to grab data that displayed in the form and when
the user clicks on a button on that form, those data will be sent to display
on the REPORT in a text box, for example, ="Your grade is " & [Grade] & "."
([Grade] is on the form)
Thank you,

In an unbound control in the report:

="Your grade is " & forms!FormName![Grade] & "."

The form must be open when the report is run.
 
Hi fredg:
Thank you for your help. I tried your way and it did show up the data.
However, I would like to see all other records on the form to show up on the
report.
For example, I have two textboxes in the report's detail section. The first
textboxes has the value ="Your grade is " & [Grade] & " and your rank is " &
[Rank] & "." and the second has almost the same values as the first one plus
a little more different values.

Assume I get two records from the record source of the form. The first
record has the empty RANK value, but the second record has the RANK value is,
say, 4. When I clicked on the button to show up the report, the first textbox
on the report shows the value of the first record correctly, but the second
textbox show empty values for both [GRADE] and [RANK]???

I suspect that the code just works for the first record. Am I right? If so,
what can I do to make all data show up?
Thank you,


fredg said:
Can you please show me how to grab data that displayed in the form and when
the user clicks on a button on that form, those data will be sent to display
on the REPORT in a text box, for example, ="Your grade is " & [Grade] & "."
([Grade] is on the form)
Thank you,

In an unbound control in the report:

="Your grade is " & forms!FormName![Grade] & "."

The form must be open when the report is run.

What I gave you is the correct method to show the value of one unbound
control on a form. It's useful, for example, when you want to show on
the report the date entered in an unbound control on a form that would
be used as the criteria for the report.

Forms do NOT in themselves contain the data of multiple records.
Tables contain data.
Forms use the Table's data to display, so that the user can see, add
to, edit, and otherwise manipulate the Tables data.
You need to create your report using that table (or a Query based upon
that table) to show all of the records.

If you click on Reports + New, the dialog will prompt you for the
style of report as well as the name of the table or query you wish to
use as the report's record source.
 
Hi fredg:
Thank you very much for trying "clearing up the air". Generally, I do agree
with you. That means I will have to select a record source (query) for the
report separately with the form's record source (even though the form's rs
and the report's rs are identical), and when I click on the button on the
form, the report's query will run again to collect all data I need.

Thank you again,
Tim
 
Back
Top