SELECT multiple sources, one is form textBox

DonkeyKong

Registered User.
Local time
Today, 02:34
Joined
Jan 24, 2013
Messages
61
I would like to reference multiple sources in my insert and I wonder if this is possible. I have probably set these tables up incorrectly since this doesn't work. Basically I have a Customer table that links to an address table by the AutoNumber CUS_NUM field which is primary key in both.

I want the CUS_NUM to come from the Customer table and the rest to come from the user input, I think. I'm not sure about a better way around this either so if there is I'm open to it.

Here's what I have....

Code:
INSERT INTO CUS_ADDRESS ( CUS_NUM, CUS_ADDRESS, CUS_ZIP, CUS_CITY, CUS_STATE, CUS_COUNTY )
VALUES ((CUS_NUM), (Forms!NEW_APPOINTMENT!CustAdd), ((Forms!NEW_APPOINTMENT!CustZip) & (Forms!NEW_APPOINTMENT!CustZip2)), (Forms!NEW_APPOINTMENT!CustCity), (Forms!NEW_APPOINTMENT!CustState), (Forms!NEW_APPOINTMENT!CustCounty));
 
This type of thing:

INSERT INTO ...
SELECT CUS_NUM, Forms!NEW_APPOINTMENT!CustAdd, ...
FROM TableName
WHERE ...
 
Thanks pbaldy!
 

Users who are viewing this thread

Back
Top Bottom