I am trying to make a generic notInList function that is called when the user types a value in a combobox that is not part of the list. In middle of that function, I want to insert the new value(s) into a table.
For some of the combo-boxes, more than one field has to be filled out in the table. (The user is asked a follow-up question about the not-in-list value, and the answer to the follow-up also has to be put into the table). The values that have to be inserted in the table are stored in variables in the code.
The way I have been dealing with this so far is through a table that has one record for each combo-box id, field, and variable name (the name of the variable that contains the value to be inserted into the field) combination. The code loops over all the records that relate to this combo-box and builds one list of field names and one list of variable names to be used in a SQL statement (Insert...values...).
However, I can't figure out how to use the name of the variable (retrieved from the table) to get the value stored in the variable. AddVar is the column in the recordset that contains the name of the variable I am trying to get the value of. I tried eval(rs!AddVar) but that doesn't work.
I am able to get the name of the variable from the table, but then I am stuck. How can I get the value (a string) stored in that variable?