Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form/report question

Status
Not open for further replies.

weltergon

MIS
Oct 1, 2002
21
US
I am trying to create a form with some options on it that are check boxes, so if option1 is checked and I go to click on a submit button on the form, those values will be used to generate a report and some text that is stored in another table will be displayed depending on which option was chosen on the form. I have a table set up with the options that feeds my form and I have another table that holds the text. Is this possible and if so, how can this be done?
Thanks
 
As long as you leave the original calling form open then the report being opened can make direct reference to the calling forms control values by using the following syntax:

Forms![frmCallingForm]![ControlName]

Post back with any further questions.

Bob Scriver
Want the best answers? See FAQ181-2886
Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Thank You,
Where do place this line of code? Will this line of code pass these value onto my query as parameters?
Thanks
 
You can make reference to this forms control through the Criteria line in the query for the Record Source of the report. This will create a WHERE clause in your query such as the following:

WHERE FORMS![frmCallingForm]![ControlName] = 1

If you need to refer to the value within the report to make modifications to controls in the report such as text field or values then you can place the reference to the code within the OnOpen event procedure of the report.

EXAMPLE:
Select Case FORMS![frmCallingForm]![ControlName]
Case 1
Me![Text1] = " report subtitle name 1 "
Case 2
Me![Text1] = " report subtitle name 2"
Case 3
Me![Text1] = " report subtitle name 3"
End Select

Post back with more questions if necessary.

Bob Scriver
Want the best answers? See FAQ181-2886
Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top