mrrayj60
Registered User.
- Local time
- Yesterday, 20:41
- Joined
- Sep 3, 2009
- Messages
- 103
I run this query from a form and it adds a record with all the information needed from the residents file, but I also want to take information from the forms source table, visitorlog and put it in the vrc table. When I try any field data it wants to add the the total rows of the visitorlog table, 688. For instance take visitorlog.state and put it in vrc.notes, once I add that it wants to append 688 rows, without I get one row with good data.
Thanks for reviewing, help files don't seem to address it, my next option would be to run a second append qry after this one.
INSERT INTO vrc ( UBL, NAME, PHONE, ADDR1, CITY, STATE, ZIP, SNAME, ADDR2, CITY2, STATE2, ZIP2, COUNTRY2, RENTALUNIT, OTHERUBL, STATUS, STATUS_DATE, UNIT, COMPLAINT_DATE )
SELECT DISTINCTROW residents.num, residents.name, residents.phone, residents.addr201, residents.city01, residents.state01, residents.zip01, residents.sname, residents.addr202, residents.city02, residents.state02, residents.zip02, residents.cntry02, residents.uleased, residents.special, "OPEN" AS Expr1, Date() AS Expr2, residents.UBL AS Expr3, Date() AS Expr4
FROM vrc, visitorlog, residents
WHERE ((([Forms]![frmVisit]![txtubl])=[residents]![num]));
Thanks for reviewing, help files don't seem to address it, my next option would be to run a second append qry after this one.
INSERT INTO vrc ( UBL, NAME, PHONE, ADDR1, CITY, STATE, ZIP, SNAME, ADDR2, CITY2, STATE2, ZIP2, COUNTRY2, RENTALUNIT, OTHERUBL, STATUS, STATUS_DATE, UNIT, COMPLAINT_DATE )
SELECT DISTINCTROW residents.num, residents.name, residents.phone, residents.addr201, residents.city01, residents.state01, residents.zip01, residents.sname, residents.addr202, residents.city02, residents.state02, residents.zip02, residents.cntry02, residents.uleased, residents.special, "OPEN" AS Expr1, Date() AS Expr2, residents.UBL AS Expr3, Date() AS Expr4
FROM vrc, visitorlog, residents
WHERE ((([Forms]![frmVisit]![txtubl])=[residents]![num]));