I am modifying a model to open and update an existing database with information from a global table. There is a row of the table that includes a unique experiment number. What I want to do is open a database, check to see if an experiment with the same number has been run. If it is duplicate experiment, I would like to update the current information in the database. If it is a new experiment, I would like to add the information from the proper column of the global table.
Right now I'm trying to use the following line of code to determine if I need to add a new database record and also identify the record if there is already one.:
dbsqlquery("Select * FROM ModelResults WHERE EXISTS (SELECT * FROM ModelResults WHERE Experiment_Number = $1)",Output[2][i]);
ModelResults is a table in the Access database
Experiment_Number is one of the database fields.
Output[2][i] is a global table value.
I would like to use the table value Output[2][i] to replace the "$1" in the formula but I am getting an error that i can't solve. I can run the query with no issues if I replace the "$1" with a number.
Thanks in advance for your help!