Datagrid in Outlook custom form

G

Guest

I am trying to place a datagrid on my custom Outlook forms. I have placed a datagrid control on the form (Microsoft Datagrid Control 6.0). I am now trying to populate the datagrid, but am having issues. I have a valid recordset with data but I get an error on my DataGrid.DataSource = myRecordSet call. Below is my code:

Dim oRS
Set oRS = CreateObject("ADODB.Recordset")
oRS.Open "Select * from mytable", oConn, 1, 3
myDataGrid.DataSource = oRS

The error I am getting is:
Object doesn't support this property or method 'myDataGrid.DataSource'

What am I doing wrong? How can I populate my datagrid?

Any help would be VERY appreciated. Thanks.
 
P

psb

You have to create the application:

Set oRS = Application.CreateObject("ADODB.Recordset")
oRS.Open "Select * from mytable", oConn, 1, 3


-We develop Office Add-ins too!
www.abistech.com
Dim oRS
Set oRS = CreateObject("ADODB.Recordset")
oRS.Open "Select * from mytable", oConn, 1, 3
myDataGrid.DataSource = oRS

The error I am getting is:
Object doesn't support this property or
method 'myDataGrid.DataSource'
 
G

Guest

As I stated in my original post, my issue is not with the recordset. I have a valid recordset with data. The error that I am getting is when I try to use the myDataGrid.DataSource method call.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top