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

Datagrid hardcode

Status
Not open for further replies.

Gill1978

Programmer
Jun 12, 2001
277
GB
Hi,

I'm new to VB and I need help to hardcode rows in a datgrid, without having to connect to a database?

Is there a way to hardcode rows??

Thanks

Julie
 
If you don't want to connect to a database, why not use a MSFlexGrid. It is easier to use than a DataGrid.

You can use the .TextMatrix(row, col) method of the FlexGrid to add a value to a cel.
 
Hi metheus,

Can you double click each row on a flexGrid to launch say a report?

Thanks
Julie
 
1) Of corse you have to connect the DataGrid to a data source, e.g. Adorecordset;
2) when you right-click the datagrid, DON'T use retrieve fields, but modify.
3) add as much columns as you need.
4) right-click the grid again and go to properties, select the columns tab and edit for each column Capion and field name.
5) click ok

Hope this was the answer you were looking for.
 
Of corse you have to connect the DataGrid to a data source, e.g. Adorecordset
Well, you don't really have to, do you? Can't you just populate the flexgrid with stuff through code?

Bob
 
Hi all ..
I got the datagrid working ()thought it best to just use a database table) ...

using
Code:
Private Sub Form_Load()
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset

Set con = New ADODB.Connection

con.ConnectionString = "Driver={SQL Server}" _
    & ";Server=SID5LONIB" _
    & ";Database=LIGHTER_DEV" _
    & ";Trusted_Connection=yes;"
con.Open
Set rs = New ADODB.Recordset

Call rs.Open("Select * From REPORTS_LIST", _
     con, adOpenKeyset)
Set DataGrid1.DataSource = rs
End Sub

But ... i've been looking around on how to double click a row pass the value of the row and open another vb form ...
but i can't find anything ...

Can anyone help??

Thanks

Julie
 
Well, the datagrid has a dblclick event, and a row property, right? Can't you use those to get what you want?

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top