|
-
May 3rd, 2000, 01:06 AM
#1
Thread Starter
Hyperactive Member
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
Code:
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")
gives me the runtime error 545
"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
-
May 3rd, 2000, 02:48 AM
#2
Thread Starter
Hyperactive Member
Never Mind!
Found it myself through trial and error. Correct code:
Code:
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 = "LAST_NAME"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|