Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling thisform brevity
Message
 
 
To
17/01/2008 04:36:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01282499
Message ID:
01282506
Views:
6
>Hi
>I have form with many Reports queries option (Page frame with almost 100 queries- crazy client).
>In the top I have combo box for year selecting (how many .. in year...).
>My question is:
>1.
>I have to get many times the year (iear=val(thisform.combyear.DisplayValue))
>I can add method 'YearQuery' and to add the code 'return val(thisform.combyear.DisplayValue)', but I have to call thisform.yearquery().
>It is not problem to do it few times but I want to know if there is shurt way (for example to add somewhere store 'thisform.yearquery()' to ty and I can type &ty
>
>
>2.
>Most of the queries The User can select '>' or '=' on the year selected.
>Again, I will have to store the user choise in variable and to run the select with the variable.
>Or even I can prevent the 'year':
>So here is my dream:
>
>*yt(1) return '='
>*yt(2)return  '>'
>*yt(3)return  ''
>*select * from customer where year(datepurchase)=thisform.combyear.DisplayValue&&very long
>**dream
>select * from customer where &yt1(datepurchase)
>**My biggest dream
>store 'select * from ' to ssf
>&ssf customer where &yt1(datepurchase)
>
>I hope the principle very clear, I dont know If I used with the correct examples but my requirement understood.

Look at TEXT to lcSQL textmerge / ENDTEXT in the Help. I usually have a method on the form which constructs where clause and then you can create the whole (or part) of select command as a string and execute it with
&lcSQL
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform