Combo Box on form - how to control what value saved in table

  • Thread starter Thread starter Piperlynne
  • Start date Start date
P

Piperlynne

I have a combobox on my frmBrand thatgrabs values from the CustomerName and
CustAutoID(primary key) field in tblCustomer.

SELECT tblCustomer.CustAutoID, tblCustomer.CustomerName FROM tblCustomer;

I set it up so that it will store the selection to the CustomerName field in
the Brand table. It is storing the actual CustAutoID, not the Customer Name.

The problem I am having is that I am using the value to assist in populating
another combobox on a different form.

In frmProject, the cboCustomerName is populated by SELECT
tblCustomer.CustAutoID, tblCustomer.CustomerName FROM tblCustomer; as well,
but it stores the actual Customer Name in the Customer Name field on the
tblProject.

I have another combobox on frmProject that has this statement SELECT
tblBrand.BrandID, tblBrand.CustomerBrand, tblBrand.CustomerName FROM tblBrand
WHERE (((tblBrand.CustomerName)=Forms!frmProjectEntry!cboCustomerName));
The problem is, the info from cboCustomerName is the text value of
CustomerName and the field in tblBrand - CustomerName is the numerical value
from CustAutoID.

What am I doing wrong???
 
I am not quite sure what you are doing but...

for the first column look in the properties of our combo box and set the
bound column to 2

for the second one try !cboCustomerName.column(x) where x is the column
number in your rowsource query. the first column is Zero which is probably
what you want
 
Back
Top