Hi, I'm working on a recordset that updates a table (an excel spreadsheet actually) based on the results from a custom form.
The input from the form is an array with the codes of companies that should be included in the query.
Example:
What I'd like to do, is to use the array as a "virtual" SQL table in my simple statement below:
Is it possible to do something like this, obviously my attempt failed. If possible, what am I missing?
Thanks in advance,
JuanPa
The input from the form is an array with the codes of companies that should be included in the query.
Example:
Code:
Dim myArray(1 to 1) As Variant
myArray(1)="001"
Code:
Dim myStatement as String
myStatement="UPDATE [Companies] " & _
"SET [Status]='01' " & _
"WHERE [CCode] IN " & myArray()
Thanks in advance,
JuanPa
Last edited: