grid  
Author Message
5Circles





PostPosted: Tue Apr 25 08:50:14 CDT 2006 Top

Exchange Servers >> grid

3 text box with user inputs. user presses the refresh comand button Based on
that the remaining data from the view should be displayed in the grid based
on the user inputs in the text box. How to get it..I need the code. Can any
one help

Exchange Server27  
 
 
Bernhard





PostPosted: Tue Apr 25 08:50:14 CDT 2006 Top

Exchange Servers >> grid Hi pereira,

> 3 text box with user inputs. user presses the refresh comand button Based on
> that the remaining data from the view should be displayed in the grid based
> on the user inputs in the text box. How to get it..I need the code. Can any
> one help
If the grid columns and the text boxes have the same control source, that should
completely do the trick. No extra code is needed

Regards
Bernhard Sander
 
 
AA





PostPosted: Tue Apr 25 10:10:07 CDT 2006 Top

Exchange Servers >> grid That's not quite clear to me. I'm gussing the the user inputs search values
that corrspond to three different columns, like firstname, lastname, and
city.
You can then in the refresh create a new RecordSource by the same name for
the grid
Function cmdRefreshButton.click
LOCAL x, y , z, r
x=Thisfor.text1.value
y=Thisfor.text2.value
z=Thisfor.text3.value
r=Thisform.Grid1.Recordsource
SELECT * FROM (r) WHERE firstname=M.x AND lastname=M.y and city=M.z
Thisform.Grid1.Recordsource= M.r

but you should look into parameterized views as a handier solution.
CREATE VIEW xx AS SELECT * FROM mytable WHERE firstname=?x AND lastname=?y
and city=?z
This view is stored in your database and can be opened by the
DataEnvironment, like any table.

Funtion Button.click
LOCAL x, y , z, r
x=Thisfor.text1.value
y=Thisfor.text2.value
z=Thisfor.text3.value
r=Thisform.Grid1.Recordsource
REQUERY(r)

-Anders




>3 text box with user inputs. user presses the refresh comand button Based
>on
> that the remaining data from the view should be displayed in the grid
> based
> on the user inputs in the text box. How to get it..I need the code. Can
> any
> one help