Link two fields to change in one

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.
 
S

Stuart McCall

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top