tangentkid
New member
- Local time
- Today, 23:53
- Joined
- Nov 19, 2007
- Messages
- 8
Hi all,
Apologies for the total Newbie question. This is my very first Access Database and I've run into problems right from the off!
I have 2 tables: Customer & Address
Amongst other things the tables contain the following fields:
Customer: CustomerID, ShippingAddressIDRef, InvoiceAddressIDRef
Address: AddressID, StreetAddress, CustomerIdRef
The idea is for a number of addresses to be associated with each customer.
When choosing a Shipping address for the customer the user is presented with a ComboBox which is populated from the Address.StreetAddress field of all Address records that have their CustomerIDRef field matching the CustomerID. i.e. all the addresses that are associated with that customer. When a street address is chosen the appropriate AddressID is then stored in the ShippingAddressIDRef field of the Customer record.
Much the same is then true when choosing an Invoice Address.
I've created a ComboBox that shows the Address.StreetAddress field and hides the Address.AddressID field. When a StreetAddress is chosen the ShippingAddressIDRef in the Customer record is set correctly. So far so good...
The problem is that I don't seem to be able to filter the entries that appear in the ComboBox to only show addresses that relate to the current company i.e. where the Address.CustomerIDRef field matches the CustomerID in the current Customer record.
I've tried putting the following SELECT in the Row Source property of the ComboBox:
SELECT Address.AddressID, Address.Street
FROM Address INNER JOIN Customer ON Address.CustomerIDRef = Customer.CustomerID;
However the effect is show all addresses for which Address.CustomerIDRef is non-zero rather than equal to Customer.CustomerID
What am I doing wrong?
Thanks.
Apologies for the total Newbie question. This is my very first Access Database and I've run into problems right from the off!
I have 2 tables: Customer & Address
Amongst other things the tables contain the following fields:
Customer: CustomerID, ShippingAddressIDRef, InvoiceAddressIDRef
Address: AddressID, StreetAddress, CustomerIdRef
The idea is for a number of addresses to be associated with each customer.
When choosing a Shipping address for the customer the user is presented with a ComboBox which is populated from the Address.StreetAddress field of all Address records that have their CustomerIDRef field matching the CustomerID. i.e. all the addresses that are associated with that customer. When a street address is chosen the appropriate AddressID is then stored in the ShippingAddressIDRef field of the Customer record.
Much the same is then true when choosing an Invoice Address.
I've created a ComboBox that shows the Address.StreetAddress field and hides the Address.AddressID field. When a StreetAddress is chosen the ShippingAddressIDRef in the Customer record is set correctly. So far so good...
The problem is that I don't seem to be able to filter the entries that appear in the ComboBox to only show addresses that relate to the current company i.e. where the Address.CustomerIDRef field matches the CustomerID in the current Customer record.
I've tried putting the following SELECT in the Row Source property of the ComboBox:
SELECT Address.AddressID, Address.Street
FROM Address INNER JOIN Customer ON Address.CustomerIDRef = Customer.CustomerID;
However the effect is show all addresses for which Address.CustomerIDRef is non-zero rather than equal to Customer.CustomerID
What am I doing wrong?
Thanks.