Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid not refreshing
Message
From
05/11/2005 07:49:51
 
 
To
04/11/2005 13:46:46
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01065483
Message ID:
01065713
Views:
18
>I've followed through the Help text and the manuals, but can't seem to get a grasp on this. I'll enter parameters, and either get a "parameter is invalid" message or get no results whatsoever. Can you point me in the right direction on making this work with parameters and requerying?
>
>>>Hi all,
>>>
>>>I've got a form with a grid that is using a view as it's source. The grid shows (among other things) order_no, line_no, part_no, price. I've also got a textbox on the form to allow the user to enter the order # he wants to view. When I enter the order #, I want the grid to show only the records that apply to that order #. I've got it setting a filter and refreshing teh form after accepting the order # in the textbox, but the grid isn't refreshing. The rest of the form is, but not the grid.
>>>
>>>Any suggestions are greatly appreciated.
>>>
>>>Thanks!
>>>
>>>John
>>
>>Don't use a filter.
>>
>>Use a view with a parameter. Set the parameter to the order # and requery the view

(1) the view has to accept a parameter
Let's assume that
- the order # is an integer
- the view parameters is OrderNumber

(2)
&& load of the form

use OrderViewOne in 0 nodata
&& if it asks for a parameters here, then the view is using the parameters outside the where clause (eg in the joins
&& in that case you have to declare OrderNumber and set its value to something that never occurs ( eg 0 or -1) prior to using the view NODATA

select OrderViewOne
&& here you can put indexes on the view 

&& a grid on the form with recordSource = 'OrderViewOne'

&& at some point, maybe Textbox.lostfocus()

local OrderNumber
OrderNumber = this.Value && make sure it's numeric: set its value to 0 in the form designer
=requery('OrderViewOne')
go top in OrderViewOne
=thisform.grid.Refresh() && maybe optional
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform