B
BobWill
I'm writing a VB script to read multiple fields from 1 table to INSERT INTO
each into separate records of another. There are many fields and I don't want
to have lots of separate insert statements. However I have a list of the
field names which I can read in from another table as strings. I want to wrap
a single INSERT INTO statement in a loop where I successively give it a
different fieldname to use as a SELECT fieldname argument. But when I try to
pass these field names to the INSERT INTO statement it writes the ascii
string and not the value of the field.
How can I make the docmd.sql(INSERT INTO TableName SELECT fieldnames)
statement see these fieldnames as arguments and not ascii strings.
each into separate records of another. There are many fields and I don't want
to have lots of separate insert statements. However I have a list of the
field names which I can read in from another table as strings. I want to wrap
a single INSERT INTO statement in a loop where I successively give it a
different fieldname to use as a SELECT fieldname argument. But when I try to
pass these field names to the INSERT INTO statement it writes the ascii
string and not the value of the field.
How can I make the docmd.sql(INSERT INTO TableName SELECT fieldnames)
statement see these fieldnames as arguments and not ascii strings.