Search code examples
excelms-accessvbavariablesrecordset

How to use variables with Recordset!


My problem is the following:

I need to assign a value to the recordset. The problem isthat I need to use a variable. So, instead of write this

MyRecordSet![field_name]

I need to write this

MyRecordSet![variable_name]

This all look simple even to me, until I find out that inside the brackets there are no quotation marks to separate strings of text from variable names. Therefore, I can't distinguish them.

Please, guys, help me! I've tried everything you can imagine.

Thanks in advance.


Solution

  • MyRecordSet.Fields(variablename)