Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie question
Message
 
 
To
21/11/2005 22:46:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01071036
Message ID:
01071062
Views:
19
>Hi everyone;
>
>A newbie question:
>
>I'm trying to create a form which will accept a parameter, and then show a grid with records from a table matching that parameter. So, if I pass a certain customer acct to the form, I'd like to filter the grid to have just those.
>
>-I've put a parameters line in the init of the form.
>- I'm assigning the parameter value to thisform.cAcct
>
>I'm not sure how to set the dataenvironment because when I try to set the filter to thisform.cAcct I get an error "Thisform is available only in a method".
>
>I've also tried to use parameterized views or just set the controlsource of the grid to an SQL statement but I'm always getting errors.
>
>Anyone can point me to the right direction?
>Thanks everyone,
>
>Alen

There are several ways of solving your problem. If you want to make a view, load it with NoDataOnLoad (there is a property in data environment). After you receive your parameter, in form's Init you'll do
vp_MyParameter = thisform.cCustomer_ID
requery('MyView')

Your grid will display all data for that customer.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform