View Full Version : Append Query creating multiple entrys!!!!!


trackmedic
01-07-2002, 11:22 AM
HELP,

I need to append information from one address table to another address table. I built an append query and ran it the first time. It worked great. What I want to do is whewn I put a new address in table one, I want it to append the new information into table 2. What its doing is creating multple entries. Such as, if I have five entries in table one and append it 1 time it makes five, append it twice and it makes ten. What am I missing or is there an easier way to do this.

PLEASE hELP!!!!! MY BOSS IS ON MY BUTt!!!

Rich
01-07-2002, 11:43 AM
Have to ask why you need two tables with the same information in each?

trackmedic
01-07-2002, 11:49 AM
OK, Lets see if I can explain this. I have a form call material transfer. On this form, I have a ship from and ship to entry point. I have made these into combo boxes that pull a companies name from the address table. Like this it works great. I made the form off of a query. Well I now want to show the respective mailing addresses for the two companies on the form. The querie I made up for the form will not let me pull the additional information into it.

Basically I want to fill in two address areas on the same form with different addresses from the same table.

Makes any sense????

Pat Hartman
01-07-2002, 04:47 PM
You don't want to append the address data to the material transfer table. I assume the material transfer table contains a FromAddressId and a ToAddressId. Change the form's query to join twice to the address table. To do this, open the querey in QBE view, add the address table twice. The second instance of the address table will be named with a suffix so it will be address_1. Then draw a join line from the FromAddressId to the first instance of the address table and draw another join line from the ToAddressId to the second instance of the address table (the one with the suffix). Select the columns you need for each address from the respective address table instances. Then to avoid confusion, you'll need to rename the address fields to avoid confusion. To do this enter the new name followed by a colon ( : ) in the field name cell. So you'll end up with something like:

Fromfld1:fld1
address

Fromfld2:fld2
address

Tofld1:fld1
address_1

Tofld2:fld2
address_1

Make sure that these address fields are NOT updateable on your form. To do that set the control's enabled property to no, locked to yes, and allowtabstop to no.

[This message has been edited by Pat Hartman (edited 01-07-2002).]