Combo Display Population

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok Say I have two tables "Customers" and a table "Orders
On my Orders table I have the Foreign Key "CustomerID" used to lookup the relevant customer.
I want to populate the customer contact details on the form into blank fields, but not store the information on the orders table as I already have the CustID to tell me who the order is for.
I can do this using the Dlookup function on an AfterUpdate on the Combo box on the orders form IE

Me!OrderForm_CustomerTel1 = Dlookup("[CustomerTel]","Customers","[ComboOrdersForms]=[CustomerID]"

So when I select a customer I tell it to go grab the Customer Telephone number where the Foreign Key in Orders matches the Primary Key in Customers and dump it in a field on my form named CustomerTel

This works fine if you are wishing to populate fields which are stored on the Orders Table which can then be also altered afterwards without messing the original contact details, however I just wish to view them
Here's the problem I have... Because the Blank fields are Unbound to the CustomerID on the order form the last selection continues to the next blank or the previous form until it is changed again.
My tables are a little more complicated, but it would be useful to know how to populate unbound fields and keep them bound to that record

Next..
Some Customers have more than one Business. I was thinking about a filtered Combo Box on the form so when you select your customer the next choice for the address is filtered down to that CustomersID.
What tables I have is Customers - Business Details - Proposal
Again On my Proposal table I only need to store the CustomerID, which should be able to give me the Customers Business details. At first i used a subform but it just reverted back to the first address after I had chosen a second. It would be ok if all my customers had just one Business address
However I believe a Combo Box wil be best on my Proposal form to display the details of the customer

Anyone got any ideas

Thank you
 
-----Original Message-----
Ok Say I have two tables "Customers" and a table "Orders"
On my Orders table I have the Foreign Key "CustomerID"
used to lookup the relevant customer.
I want to populate the customer contact details on the
form into blank fields, but not store the information on
the orders table as I already have the CustID to tell me
who the order is for.
I can do this using the Dlookup function on an
AfterUpdate on the Combo box on the orders form IE.
Me!OrderForm_CustomerTel1 = Dlookup ("[CustomerTel]","Customers","[ComboOrdersForms]=
[CustomerID]")

So when I select a customer I tell it to go grab the
Customer Telephone number where the Foreign Key in Orders
matches the Primary Key in Customers and dump it in a
field on my form named CustomerTel1
This works fine if you are wishing to populate fields
which are stored on the Orders Table which can then be
also altered afterwards without messing the original
contact details, however I just wish to view them.
Here's the problem I have... Because the Blank fields are
Unbound to the CustomerID on the order form the last
selection continues to the next blank or the previous form
until it is changed again.
My tables are a little more complicated, but it would be
useful to know how to populate unbound fields and keep
them bound to that record.
Next...
Some Customers have more than one Business. I was
thinking about a filtered Combo Box on the form so when
you select your customer the next choice for the address
is filtered down to that CustomersID.
What tables I have is Customers - Business Details - Proposals
Again On my Proposal table I only need to store the
CustomerID, which should be able to give me the Customers
Business details. At first i used a subform but it just
reverted back to the first address after I had chosen a
second. It would be ok if all my customers had just one
Business address.
However I believe a Combo Box wil be best on my Proposal
form to display the details of the customer.
Anyone got any ideas?

Thank you!


.
Make a combo box ( cboCustomer) on the Orders form and put
the CustomerID as the bound column 1, the Customer Name as
column 2, Address as column3, Phone as column 4... so on
for all the fields you want to show on your order form.
Then set the column widths so only the Customer Name
shows. Then make as many unbound text boxes as you have
fields for Customer details like phone and address.In the
control source for the Address text box put
=cboCustomer.column(2) and so on for the others. The thing
to remember is that when referencing a combo box this way
the first column is zero and not one. That will keep you
from having to do Dlookups which I believe are costly as
far as load time on the form is concerned.
 
Thanks Alan,

I guess that would work, however some of my customers have more than one business. I think I need a customer ID combo field and then one just for the business which has been filtered by the customer.
 
Back
Top