I have a form with an ADODC and some text boxes. If I set the ADODC's properties and the text box DataSource and DataField at design time, it runs fine. But I need to set them at run time since I employ temporary tables elsewhere in the code.
The code
gives me the runtime error 545Code:Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & frmSICC.CadenaConexión & ";Persist Security Info=False" Adodc1.RecordSource = "Select LAST_NAME, FIRST_NAME, CODE From Personnel Where IdCONTACT_CLASS = 'EMERGENCY' Order By LAST_NAME, FIRST_NAME" Set LastName.DataSource = Adodc1 txtLastName.DataField = Adodc1.Recordset.Fields("LAST_NAME")
"Unable to bind field or data member " and then the value of the first record's LAST_NAME field
Any ideas why this is so? Thanks,
Andrew




Reply With Quote