0

I'm currently working on a project which looks like this:

set rs15 = new adodb.recordset
dim course1 as string
course1=label1

rs15.open " select * from  CourseYear where Surname like' " & text12 & " ' ", con1, 3, 3

rs15!(course1)=text1.text
rs15.update


msgbox "success"

course1 is a string contains the label1 which corresponds to the field name on my database. I was trying to call that label in rs15!(course1), but it says type-declaration character does not match the datatype.

1 Answer 1

1

You can access a variable named field by using the Fields property directly. Instead of the recordset!fieldname notation use recordset.Fields(fieldname).

In your case this would be: rs15.Fields(course1)=text1.Text

See here for more information

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.