Hi,

I have a data object named dataCounter and a MSFlexGrid named gridCounter.

I am trying to set the gridCounter.datasource to the dataCounter

Dim dbMyDB As Database
Dim rsMyRS As Recordset

Set dbMyDB = OpenDatabase(App.Path & "\Counter.mdb")
Set rsMyRS = dbMyDB.OpenRecordset("CounterTable", dbOpenDynaset)

Set gridCounter.DataSource = dataCounter

I keep getting a Run-time error “91”. Can anyone suggest anything?

Thanks very much!!

Recommended Answers

All 4 Replies

Set gridCounter.DataSource = dataCounter?

Where is it defined?

Set gridCounter.DataSource = rsMyRs

Good Luck

Thanks vb5prgrmr!

I tried that, but I keep getting the same error.

So, Object variable not set...

Use the data form wizard to recreate the ADODC and grid you want. Then take that and place on your form.

Good Luck

Thanks vb5prgrmr!

That worked!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.