PDA

Click to See Complete Forum and Search --> : DATA CONTROL


jpierre3
Nov 16th, 1999, 02:57 AM
How can i change the property :
RecordSource
of a DATA CONTROL at runtime.
When i change the property and i call :
Refresh Method.
I receive an error :
Object doesn't not support this property or method.

Serge
Nov 16th, 1999, 08:37 PM
Try this. After you modified the RecordSource property:

Data1.Recordset.Refresh

Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)

jpierre3
Nov 16th, 1999, 09:10 PM
I receive an error when i try to refresh the Data1.

Private Sub Command1_Click()
On Error Resume Next
Data1.Recordset.Close

Data1.RecordSource = ""
Data1.RecordSource = "EMPLOYE"

Data1.Refresh
Data1.Recordset.Refresh

txtFirstName.DataField = ""
txtFirstName.DataField = "EMPL_FST_N"
End Sub

Private Sub Command2_Click()
On Error Resume Next
Data1.Recordset.Close

Data1.RecordSource = ""
Data1.RecordSource = "SUPERVIS"

Data1.Refresh
Data1.Recordset.Refresh

txtFirstName.DataField = ""
txtFirstName.DataField = "SUP_FST_NM"
End Sub