Adding information from a form into a table

  • Thread starter Thread starter Guest
  • Start date Start date
If it's a bound form (the norm), you don't have to do anything. Forms are
intended to be "windows" to tables. A bound form will automatically write
its data to the table when the current row loses focus.

If it's an unbound form, you have to add the data yourself, either using a
SQL INSERT INTO statement, or using VBA and a recordset.
 
The fields are unbound. Can you help me with the SQL INSERT INTO statement.
I had tried to use this and it didn't work so I must be doint something wrong.
Thanks!
 
Is there a reason why you're not using a bound form?

Unfortunately, you haven't given any details, so I can't really offer any
sample code.
 
Sorry, the form is a bound form. I have a 8 combo boxes (unbound) which pull
from tables in the database. I aslo have 4 free form text boxes. What I
want to do is select particular values in the combo boxes and enter text into
the text boxes. Once I have completed the form I would like to click a
button and have the data just entered append to a different table?
Does that help?
 
I'm afraid that doesn't make sense to me. If the form is bound, then your
updates will be made against the table(s) that make up the RecordSource of
the form. If the data's being stored there, why would you want to also store
it redundantly in some other table(s)?
 
I am not explaining myself very well. Let me try again.
I have combo boxes pulling from separate tables. i.e. one table has a list
of cities, one table has a list of states, one table has a list of
category/programs. What I wan the user to do is be able to pick an origin
city, origin state, destination city, destination state, category/program,
and enter in "savings" into one of the text boxes. There are a multitude of
different combinations of the above. Rather than the individual typing the
lane, category and savings to me in an e-mail and me re-typing it into a
table, I wanted to have an entry box. I need to have the list of cities
because I need to make sure they are entered in a particular format. Does
this make sense?
 
What you're describing is certainly doable with a bound form.

Assuming you have a table (call it DataTable) into which you're going to
store the details, that table (or a query based on it) would be the
recordsource for the form. In the detail section of the form, you'd have
your various combo boxes, each with an appropriate RowSource. However, each
combo box would be bound to a specific field in the underlying recordsource.
In that way, DataTable gets updated when you finish providing details for a
row, picking up the details from each combo box.
 
Back
Top