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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append only Specific Record

Status
Not open for further replies.

Begin76

Technical User
Jan 13, 2003
9
0
0
US
Hello,

I have two tables - Vendors and Manufacturers. I wanted to use an append query to append those vondors that are manufacturers as well. I have created an append query and it works but it appends all the records that are not the already there. I set the Company name property as a indexed (no Duplicates) so it will not update the records that are already there but if I have a vendor that is not a manufacturer it appends that record as well.

I was hoping I could make the query record specific. therefore on my form will be a contral that will append only that record. How do I do this - I cannot get my head around it.

Thanks
 
Without knowing the exact layout of your tables it's a bit difficult to give you an exact answer but you might try using something like the following:

insert into [new_table] select * from vendors where vendors.vendor_id in (select manufacturer_id from manufacturers);

Please provide details of your tables and I'll try to be a bit more specific, eg. custom the above to your DB.
 
Sorry, should have provided more detail. I have two tables that are alike. Fields are as follows;

tblvendor.vendorid
tblvendor.companyname
tblvendor.address
tblvendor.city
etc...

tblmanufacturer.manufacturerid
tblmanufacturer.companyname
tblmanufacturer.address
tblmanufacturer.city
etc...

When I have a vendor that is also a manufacturer I want to have a button on my form that will append the vendor to the manufacturer. The append query works but it will append all of the records in vendor.

I got around this by adding a yes/no field to the vendor table called tblvendor.addtomanufacturer adn have the append query check to see if the value is yes/true.

This will suit my purposes but I was hoping to set it up so I just had a button on my vendors form to append the specific record.

Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top