Using Access 2000, what is the correct syntax for using a variable to reference a field name when trying to read/write text in that particular field in a DAO recordset? For example, the code
[ strData = rstSample![My Field] ]
returns the contents of field [My Field] from recordset Sample just fine. However, I have a list box that I use to select the field name. I want to use the selected field name from that list box in the code to read/write text in that particular field. The code below
[ strData = rstSample!Me![lstListBox] ]
doesn't work. I get a message "Run-time error 3265: Item not found in this collection".
I have tried to find information on this in bookstores with no luck at all. All suggestions will be greatly appreciated. Thanks.
[ strData = rstSample![My Field] ]
returns the contents of field [My Field] from recordset Sample just fine. However, I have a list box that I use to select the field name. I want to use the selected field name from that list box in the code to read/write text in that particular field. The code below
[ strData = rstSample!Me![lstListBox] ]
doesn't work. I get a message "Run-time error 3265: Item not found in this collection".
I have tried to find information on this in bookstores with no luck at all. All suggestions will be greatly appreciated. Thanks.