Gloria,

 

The help suggests that in

 

            Set DataGrid1.DataSource = D

 

That D be a RecordSet or some other record oriented data object, and not a simple string that’s the name of a data object.

 

Rich McNeil

Boston Software Systems

866 653 5105

www.bostonworkstation.com


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gloria Mallory
Sent: Monday, April 04, 2005 3:49 PM
To: '[email protected]'
Subject: RE: [Talk] DataGrid Control

 

Rich,

 

I had already tried that command.  It gives me an error - run-time error 424 - object required.

 

Gloria Mallory

Good Shepherd Medical Center

903 315-5120

[EMAIL PROTECTED]

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich McNeil
Sent: Monday, April 04, 2005 1:47 PM
To: [email protected]
Subject: RE: [Talk] DataGrid Control

 

Gloria,

 

I see what your saying about the differences in VB6 and VBA.  I suspect that you'll be able to set the DataSource property (which is itself an object) in your script with a

 

            Set DataGrid1.DataSource = ???

 

Statement.  This is copied from VB's help:

 

DataSource Property (ActiveX Controls)

Returns or sets a data source through which a data consumer is bound to a database.

Syntax

object.DataSource [=datasource]

The DataSource property syntax has these parts:

Part

Description

object

An object _expression_ that evaluates to an object in the Applies To list.

datasource

An object reference that qualifies as a data source, including ADO Recordset objects, and classes or user controls defined as data sources (DataSourceBehavior property = vbDataSource). 

 

Remarks

Use the Set statement to set the DataSource property, as shown below:

Set DataGrid1.DataSource = ADODC1

Note   Two older controls, the Data control and RemoteData control, can be used as data sources, however you cannot set the DataSource property of another control or object to either of these controls at run time. For example, the following code will fail:

Set Text1.DataSource = Data1    ' Will fail! You can't set DataSource at 
                              ' run time to an intrinsic Data control.

To use either the Data control or RemoteData control as a data source, you can set the DataSource property of bound controls at design time only.

 

 

Rich McNeil

Boston Software Systems

866 653 5105

www.bostonworkstation.com


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gloria Mallory
Sent: Monday, April 04, 2005 1:10 PM
To: '[email protected]'
Subject: [Talk] Datagrid Control

 

 

When I place a datagrid control on a userform in BWS, it does not include the datasource property so I am using the datamember property instead; however, when I place a datagrid control on a form in Visual Basic, I do see the datasource property.  When I run the VB code, the datagrid is populated with a list of physician mnemonics; however, it will not populate in BWS.

 

Does anyone have any ideas on correcting my problem?

 

Thank you for your assistance.

 

Gloria Mallory

Good Shepherd Medical Center

903 315-5120

 

Reply via email to