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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing values from form to report.

Status
Not open for further replies.

jspellman

Programmer
Aug 18, 2001
23
US
I have a problem. I have a form say (form1) with a text box (text1). I would like to pass the value of text1 to a report form (report1). I have tried the following:

form1.init()
lparameter clocation

form1.destroy()
clocation = thisform.text1.value

report form report1 to printer preview with clocation

I can't figure out what is wrong with this. I had it working once before but can not duplicate what I did.

Thanks in advance.


John
 
Not exactly clear on what you have here.

report form report1 to printer preview with clocation
the report command does not have a WITH mofifier.

if you are trying to run a report from a form
REPORT FORM myform.........
and have it use a varible, then with the report open in design mode, define a variable that you can use. Or make the variable public. it is hard to say excatly with out knowing your environment.

if you are trying to pass a variable to a form...
DO FORM myform WITH myvar

in the init of the myform
PARAMETERS myvar Attitude is Everything
 
What I am looking for is a way to open a form and select the location say (Dallas, TX). When I close the form I would like a report to run called (sales by location). When the report runs I only want to see the location (Dallas, TX). For some reason I can not get the variable to pass to the report so the report can read the variable.

Thanks
 
whick form is running the report?

if the main form. then use the
DO FORM selectform TO myvar

in the selectform unload event
RETURN yourvalue

then run the form

REPROT FORM myreport WHILE somefield = yourvalue

Attitude is Everything
 
I will try this. It giggle my memory. Seems I did something like this before. Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top