Writing to a table through vba

C

Carlos

Hi Everyone,

What are the steps and syntax to open a connection, write
something to a table, close the connection?

I have a subform with 3 links to the main form so
everytime something in the subform is changed it
automatically saves 3 other fields but I need it to save
one more so I have to code it to write itself.

Unless you know another way?
 
A

Alex Dybenko

for example you can fo the following (in case you use ADO)
currentproject.activeconnection.execute "insert into Table1 (f1,f2,f3)
Values (" & me.textbox1 & "," & me.textbox2 & "," & me.textbox3 & ")"
 
G

Guest

Im not using ADO. I have a db on the network. The forms
and queries are loaded on the c drive and it is linked to
db on the network. I dont use any special connections
just a straight up link.
 
A

Alex Dybenko

well, then i dont understand what you really need. try to explain once more
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top