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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSHFlex Grid Row Selection

Status
Not open for further replies.

hkung

Programmer
Jan 9, 2001
19
0
0
MY
Hi all,

I have a MSHFlexGrid, which will populate data selected from a query. I managed to get the number of record in the grid. However, i need the selected row to be the last record in the grid once the grid is being loaded. How can i go abt it? Thanks in advance.
 
Hi hkung,

so, you want to populate the MSFLEXgrid and each row you insert, you want it to be the last and put your msflexgrid pointer on it.

So, on you cicle of loading each row, make a :

imagine the data of your query is on a data control

Data9.DatabaseName = App.Path & "\hotel2.mdb"
Data9.RecordSource = "select * from user"

With Data9
.Recordset.MoveFirst
Do Until .Recordset.EOF
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1 ' gives one more row to the grid
'now, put the data in each row as you wish
' ...

MSFlexGrid1.Row = MSFlexGrid1.Rows - 1
' this will put the pointer in it's place
MSFlexGrid1.Text = .Recordset.Fields(1)


.Recordset.MoveNext
Loop
End With ===================
* Marta Oliveira *
===================
marta100@aeiou.pt
-------------------
CPC_TA- Braga
-------------------
Portugal
===================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top