Link two fields to change in one

  • Thread starter Thread starter DDBeards
  • Start date Start date
D

DDBeards

In a table I have two fields (of many) that are dedicated to the customers
iDNum and the customers department. I have a second table that contains all
the customer's data with the iDNum as the key field. Now on a form I have a
field that ask the user to select a customer in a drop down box that pulls
the data from the 2nd table (tblCustomer). After the selection is made, I
want the customers department to be updated with the department from the
tblCustomer based on the iDNum selected.

I have done this before with a subform but am trying to do this with out
another subform. Thanks for your help.
 
DDBeards said:
In a table I have two fields (of many) that are dedicated to the customers
iDNum and the customers department. I have a second table that contains
all
the customer's data with the iDNum as the key field. Now on a form I have
a
field that ask the user to select a customer in a drop down box that pulls
the data from the 2nd table (tblCustomer). After the selection is made, I
want the customers department to be updated with the department from the
tblCustomer based on the iDNum selected.

I have done this before with a subform but am trying to do this with out
another subform. Thanks for your help.

So your customer selection combo on the popup forms has 2 columns, one for
iDNum (possibly hidden) and one for the customer name, right?

If so, add the customer's department as a new column in the combo's query,
then adjust the combo's ColumnCount and ColumnWidths properties to hide the
new column. Let's say the new column is the third column. This is actually
comboname.column(2), because columns are zero-based.

Now all you need to do is assign the combo's department column to your
department control:

Me!CustomerDepartment = Me.ComboName.Column(2)
 
Back
Top