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

DATA GRID AGAIN

Status
Not open for further replies.

FredNg

Programmer
Jun 25, 2003
4
MU
Hi all,
I'm just a beginner going crazy.

I have tried this on a flexgrid control and it worked but now I am trying to make it work on a datagrid control but it keeps giving me the error
Run time error ‘7005’
Rowset not available

I have a text box which I have inputed some text say “Fred”
Now when I click on the cmdDisplay command button I want it to be displayed on a particular cell on the datagrid say cell row1, column 0

It worked on the flexgrid with the fol coding :
Private Sub cmdSave_Click()
mfgName.Rows = 2
mfgName.Col = 0
mfgName.Row = 1
mfgName.Text = txtName.Text
End Sub

How do I make the above work on a datagrid ?
First there isn’t the property Rows in the datagrid
When I tried ignoring the above and writing only .col = 0 and .row = 1 it returns the error “Rowset not available”

Fred

 
From VBA help:
"DataGrid Control:
Displays and enables data manipulation of a series of rows and columns representing records and fields from a Recordset object.

The data-aware DataGrid control appears similar to the Grid control; however, you can set the DataGrid control's DataSource property to a Data control so that the control is automatically filled and its column headers set automatically from a Data control's Recordset object. The DataGrid control is really a fixed collection of columns, each with an indeterminate number of rows."

There's a difference between FlexGrid and DataGrid. You can easily create rows and columns in FlexGrid. It works like a Excell sheet. But DataGrid needs a Recordset tu show data from. You must create recodset (temporary or from table) and then use it in DataGrid.
Try VBA help for more information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top