Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add selected record from one table to another (append query?)

Status
Not open for further replies.

SBelyea

Technical User
May 29, 2008
46
US
Hi everyone -

Here's the current situation:

I have a form which has two subforms. Subform A is a list of all the ongoing projects (the subform source is a table). Subform B is a list of the projects associated to a specific manager (subform source is also a table). I'm trying to allow the user to:

1. Select a record in Subform A
2. Press a button
3. Have the selected record be dropped into Subform B

From what I've gathered, an append query would be the perfect solution for this problem. Unfortunately, I've been unable to figure out how to make an append query take the one selected record and append it to the source table for Subform B.

I've been spinning my gears on this for a while - any help that tek-tippers can provide would be greatly appreciated!

- sbelyea
 
Something like...
Code:
INSERT INTO tableB
(SELECT * FROM tableA WHERE FieldName = Forms!FormName!TextBoxName)
where the text box is a key field in the table.


Randy
 
since it is a sub form it would be more like
Code:
INSERT INTO tableB
(SELECT * FROM tableA WHERE FieldName = Forms!FormName![COLOR=green]SubformControlName!form![/color]TextBoxName)
 
Gentlemen, thanks for all of the assistance. It was actually a silly syntax error on my part (missing two apostrophes) that prevented it from working. All is well now! Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top