Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill grid automaticly

Status
Not open for further replies.

astech

Programmer
Jul 25, 2000
59
0
0
ID
I have a class form with a grid inside, so how can i fill the grid automaticly with a table selected, after created a form with that class form.



 
thisform.grid1.recordsource = alias()
thisform.grid1.refresh() && May or may not be necessary

boyd.gif

[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
Thanks for your advice Mr.craigsboyd,

But it will show all field in grid.

here i mean :

with that classform, i create 2 forms :
FromName :FormA
Table :TableA (Kode,Name,Address,phone,email)
Field use: Kode,Name,phone,email

FromName :FormB
Table :TableB (Kode,Name,Address,phone,email)
Field use: Kode,Name,Address

in the gridclass i put 3 propertyclass,
the function is for selecting fields to show in grid.
ALias (C) = Table Name
maxField (N) = How much columns in grid
FieldUse (C) = Fields use in columns

eg:
In grid in FormA i put:
ALias= TableA
maxField = 4
FieldUse = Kode,Name,phone,email

********************************
So how to fill the field selected into the grid.

Thanks for all supports.







 
In that case, you also need to specify the columncount and the ControlSource for each column:
Code:
thisform.grid1.recordsource = alias()
thisform.grid1.refresh() && May or may not be necessary  
thisform.grid1.colummcount = 5
thisform.grid1.column1.controlsource = (alias()+"."+field(1))
thisform.grid1.column2.controlsource = (alias()+"."+field(2))
etc.


-BP (Barbara Peisch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top