Tricky little combo/table problem

  • Thread starter HowardChr via AccessMonster.com
  • Start date
H

HowardChr via AccessMonster.com

Here's a tricky little problem I am trying to figure out. I'm sure someone
out there should be able to help me without breaking anything. Heres the
problem.... I have a form that has an underlying table attached. I have a
combo box pull in a pull down list of locations from that table. What I would
like to happen is, I would like it so the user will select a location from
that combo box, and then click a command button. When they click that button,
I need whatever they chose in the comobo box to copy over to a NEW table,
which will be referenced later by my program. Say the table being pulled from
is called "table1", and the table I need the info to go to is "newtable". I
guess it doesn't SOUND hard, but I can't seem to figure anything out on it.
I'll let you experts tear it apart and tell me how dumb I am for not knowing.
Be kind... I'm still a noob.
 
G

Guest

Easy one. You can use a command button if you wish or you can just use the
After Update event of the combo box control.

Create an append parameter query that appends the data to new table. The
parameter would be based on the value in the combo. Execute the query when
the button is clicked or in the after update of the combo.
 
H

HowardChr via AccessMonster.com

I'm all for using the after update event of the combo box, however how would
it know what selection I chose? Also, I'm not real sure what or how to use
an append parameter.... Could you give some more details? MANY thanks!
Easy one. You can use a command button if you wish or you can just use the
After Update event of the combo box control.

Create an append parameter query that appends the data to new table. The
parameter would be based on the value in the combo. Execute the query when
the button is clicked or in the after update of the combo.
Here's a tricky little problem I am trying to figure out. I'm sure someone
out there should be able to help me without breaking anything. Heres the
[quoted text clipped - 8 lines]
I'll let you experts tear it apart and tell me how dumb I am for not knowing.
Be kind... I'm still a noob.
 
G

Guest

Sure, no problem.
Use your query builder to create an append query that will append data to
"NewTable". It should be based on Table1 like your form is. Then in the
Criteria row of the field in Table1 you want to filter on, which would be the
field the combo box is bound to, put the following:

Forms!MyFormName!MyComboBoxName

(It is not necessary that the combo be a bound control. In fact, most of
the time I don't use combos as bound controls.)

Now, the query will filter on the value in the combo box. To run it, put
something like this in the After Update event of the combo:

CurrentDb.Execute("qappAddToNewTable"), dbFailOnError

--
Dave Hargis, Microsoft Access MVP


HowardChr via AccessMonster.com said:
I'm all for using the after update event of the combo box, however how would
it know what selection I chose? Also, I'm not real sure what or how to use
an append parameter.... Could you give some more details? MANY thanks!
Easy one. You can use a command button if you wish or you can just use the
After Update event of the combo box control.

Create an append parameter query that appends the data to new table. The
parameter would be based on the value in the combo. Execute the query when
the button is clicked or in the after update of the combo.
Here's a tricky little problem I am trying to figure out. I'm sure someone
out there should be able to help me without breaking anything. Heres the
[quoted text clipped - 8 lines]
I'll let you experts tear it apart and tell me how dumb I am for not knowing.
Be kind... I'm still a noob.
 

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