Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keep the report open without any record returned!
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00352954
Message ID:
00355187
Views:
23
Hi Diane,
The easiest way is to put the information you want saved in the CALLING form, not the form where you have the variables. I'm a little confused about your form names, so I'm going to rename them:

1: Main form (MyMainForm) which has a "Get Report Parameters" button, a "Print Report" button and form properties for Product Name, Quality and any other variables you want to use in your parameters.

2: Parameter Form (ParamForm) which has text boxes or combos for each parameter and a form property OCallingForm

3: Report (MyReport)

When you call the ParamForm from MyMainForm, pass the 'form object' of MyMainForm.

Do form ParamForm with THISFORM && THISFORM will pass an Object type variable which refers to MyMainForm.

In the INIT() of ParamForm, you'll have a parameter line and put the object into the form variable

**INIT Code
lparameter oForm
if type('oForm') ="O"
   thisform.oCallingForm = oForm    && This stores the variable you passsed to a form variable so you can use it any time.
endif
In the OK button Click() code, you store the information back to MyMainForm
thisform.oCallingForm.ProductName = Thisform.TxtProductName.value
thisform.oCallingForm.Quality = thisform.TxtQuality.value
thisform.release
You don't need to do anything with the UnLoad code - the information is already back in MyMainForm. Finally, you use the MyMainForm properties to update your cursor/view for the report.

I hope this is clear. Feel free to check anything I didn't make clear.

Barbara

>Hi Barbara,
> I hope that you understand what I am going to describe below. If you have experience on that, please help me again Barbara!
> I tried to create a parameter form for my own to go to the reports(and forms also). Before I used the default "view parameter", and it's inconvenient because the users got confused by its design. The way I created my parameter form is:
> *Create a small form which has 1 textbox(to enter the Product's name), a button(to go to the report or form)
> *On this small form, I add a variable to its "Property/Method" which I call variable_Proname. Then on "VALID" method of the Text I have
> thisform.variable_Proname = thisform.Text1.value
> *For "Unload" method of the small form, I have
> return(this.variable_Proname)
> *For the button, I have "thisform.release"(click method)
> *The code for the "Stored Procedures":
>***************
> procedure find_product
> local proname(this is what I have for the filter of the "View designer")
> proname = ""
>
> do form connect_proname to proname (to connect the small form to the view)
> if !empty(proname)
> = requery("inventory")
> endif
> endproc
>****************
> Finally, for the form or the report(my destination), I call the "Procedute"
> *****
> do find_product
> dodefault()
> *****
> Everything works beautifully for me in this way. But the problem I have now is I am not only looking for the "product name" but also the "quality" of the products. If I have more than 1(or more) variable on the small form(2 filters for the "view designer") how to deal on the Procedure?
> Once again, I really need your advice here.
> Thank you so much in advance.
> Diane.
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform