How do I get Datagrid to work

C

Chris L. Park

Hello
I am working on a form that contains a combo-box, a Option button group and
a data grid. Based on the information in the combo-box and the button
selected in the option group, I can create the proper Sql statement to get
the data. What I am having problem with is getting this data attached to the
datagrid? I do have the ADO Connection working to database.

I am using Access 2000
Microsoft Datagrid Control 5.0 (sp6)

TIA
Chris
 
M

Michel Walsh

Hi,


You should try a subform rather than a datagrid, if you are using
Access.

If you are using VB6, first, open a ADO recordset, rst, such that its
scope make it visible for all the form. then, use something like:

With Me.DataGrid1
Set .DataSource = rst
.ClearFields
.Rebinds
End With


Do not miss the dots. Be sure the recordset is "visible" anywhere under the
form, and that you can navigate through it (forward and backward).



Hoping it may help,
Vanderghast, Access MVP
 

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