Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized Views...Referencing
Message
From
31/03/1999 09:54:59
 
 
To
31/03/1999 09:42:19
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00203633
Message ID:
00203844
Views:
18
>Erik -
>
>Once again, thanks for the reply. I picked up a lot on your last message. I feel I am getting close!!
>
>After reading your reply, I have a few questions that revolve around the actual setting of the parameter.
>
>First, let me quickly give you background on what I am trying to accomplish, so that my question will make more sense.
>
>I have an "orders" table and an "orders_detail" table and a "products" table. I went to the view designer and created a p-view, using the orders_detail and products table.
>
>My WHERE command in my SQL statment for my view now reads:
>WHERE orders_detail.norderid = ?lnorderid
>
>The purpose of the view is so that when I am scrolling through records on my "orders" form, my view (extended_price_detail), which is a grid, will be updated with the appropriate product information for each new record.
>
>
>OK
>
>
>The code for my init event of my "orders" form is as follows:
>
>LPARA tnOrderID
>
>IF TYPE("tnOrderID") = "?"
>lnorderid = tnOrderID
>ELSE
>RETURN .F.
>ENDIF
>
>REQUERY("extended_price_detail")
>__________________________________________________________
>
>My question is, what do I set the variable to so that each time I scroll to a new record on my "orders" form, my grid (p-view) is updated properly.
>
>This question is directly related to the following line of code:
>
>IF TYPE("tnOrderID") = "N"
>
>Would "N" be "THIS.Value" ??? or a range of numbers, such as 1 -999,999,999,999?
>
>I can't set the paramter to a specific number, b/c the view has to be updated for every record that I scroll to. This question is slightly embarrasing, but honestly I don't know what to set the parameter to for the grid to work in harmony with the rest of the form.
>
>TIA for any additional comments
>
>Jason

You'll need to save the orderid to a form property and reset the variable each time you requery; the initial variable goes out of scope as soon as the init event finishes.

The type of the parameter must match the type of the field; if someone passes in a character string, you've got to convert it to a number.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform