Unbound form writing back to table

R

Roll_Tide315

I have a form with two text boxes. I want to take what the user enters into
those text boxes and write that data back to a table. I know I bound those
text boxes to the table but I want to keep them unbound and use some kind of
VBA code to say AFTER UPDATE, write back to a table I specify.
 
A

Allen Browne

Provide buttons for Ok and Cancel on your form.

In the Ok button's Click event procedure, exeute an append query statement
to add the data to the desired table.
 
R

Roll_Tide315

How do you refer to a form within a query? I thought you could only query
data that is stored in a table or in another query. How do you tell the query
to get the data from the form and append to a table?
 
A

Allen Browne

We are not talking about a saved query here.

Build a string containing a SQL statement, and Execute it.
 
R

Roll_Tide315

Would you mind explaining? I am just starting to learn SQL. To make things
simple, on my form i have 2 text bozxes: first name and the second last name.
When the user enters a name, I want the name to appear a table I made called
User name. Could you please walk me through buidling the SQL statement? Thank
you!

Allen said:
We are not talking about a saved query here.

Build a string containing a SQL statement, and Execute it.
How do you refer to a form within a query? I thought you could only query
data that is stored in a table or in another query. How do you tell the
[quoted text clipped - 14 lines]
 
R

Roll_Tide315

Would you mind explaining? I am just starting to learn SQL. To make things
simple, on my form I have 2 text boxes: first name and the second, last name.
When the user enters a name, I want the name to appear a table I made called
User name. Could you please walk me through buidling the SQL statement? Thank
you! I realize I am making this hard on myself by not binding the form's text
boxes but I want to learn the SQL part.

Allen said:
We are not talking about a saved query here.

Build a string containing a SQL statement, and Execute it.
How do you refer to a form within a query? I thought you could only query
data that is stored in a table or in another query. How do you tell the
[quoted text clipped - 14 lines]
 
A

Allen Browne

Here's an example of exeucting a query statement:
http://allenbrowne.com/ser-60.html

If you really are starting out, you should investiage bound forms first.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Roll_Tide315 said:
Would you mind explaining? I am just starting to learn SQL. To make things
simple, on my form I have 2 text boxes: first name and the second, last
name.
When the user enters a name, I want the name to appear a table I made
called
User name. Could you please walk me through buidling the SQL statement?
Thank
you! I realize I am making this hard on myself by not binding the form's
text
boxes but I want to learn the SQL part.

Allen said:
We are not talking about a saved query here.

Build a string containing a SQL statement, and Execute it.
How do you refer to a form within a query? I thought you could only
query
data that is stored in a table or in another query. How do you tell the
[quoted text clipped - 14 lines]
of
VBA code to say AFTER UPDATE, write back to a table I specify.
 

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