Hi,
I used this VBA, for inserting in another db:
it worked fine, but I now, however, want to rebuild it.
Instead of inserting the value from the DB, I want to insert some global arrays I defined in the project.
I tried this code:
I need to do this, since db1 has one field for name, while db2 has two fields for name.
I've already made a VBA function to divide the name into fnam and lnam (Firstname and Lastname), so the rest should be simple, if I can get my query working.
I will also have to insert some other data from db1.table1 to db2.table2.
eg. db1.table1.field1 => db2.table1.field1 and .field2
db1.table1.field2 => db2.table2.field1
Olav Alexander Mjelde
Admin & Webmaster
I used this VBA, for inserting in another db:
Code:
CurrentProject.Connection.Execute "INSERT INTO kunde " & _
"SELECT navn AS kundenavn, id AS ekspd_id FROM tbl_navn " & _
"WHERE id = " & tmpId & " AND " & _
"skal_digitaliseres=True And sendt_til_dig=False;"
it worked fine, but I now, however, want to rebuild it.
Instead of inserting the value from the DB, I want to insert some global arrays I defined in the project.
I tried this code:
Code:
CurrentProject.Connection.Execute ("INSERT INTO kunde " & _
"(id, kundenavn, ekspd_id) VALUES ('', " & tmpNavn & "," & tmpId & ");")
I need to do this, since db1 has one field for name, while db2 has two fields for name.
I've already made a VBA function to divide the name into fnam and lnam (Firstname and Lastname), so the rest should be simple, if I can get my query working.
I will also have to insert some other data from db1.table1 to db2.table2.
eg. db1.table1.field1 => db2.table1.field1 and .field2
db1.table1.field2 => db2.table2.field1
Olav Alexander Mjelde
Admin & Webmaster