View Full Version : autofilling fields


Markatthepub
01-09-2003, 06:29 AM
Help please,

If I select a supplier in a field, the next field allows me to select an engineer attached to that supplier. If i select the engineer from the list how do i get his/hers telephone number to automatically display in the next field.

thanks and thanks again

Mark

shay
01-09-2003, 11:34 AM
Hi there

I assume the Engineer's name is being selected from a combo box. I would include the telephone number as a hidden column in the combo box (ie make the column width = 0). Then in the combo box's AfterUpdate event, put the following line:

txtTelephoneNo = Me.cmbEngineer.column(1)

You'll need to change the control names and the code assumes the telephone number is in the 2nd column of the combo box.

hth

shay :cool:

Markatthepub
01-10-2003, 02:50 AM
Shay,

Thanks for your help, it is indeed a combo box. I'll incorporate the change and see how I get on

thanks again

Mark

shay
01-10-2003, 02:56 AM
Hi

Here's an even simpler solution. Put

= Me.cmbEngineer.column(1)

in the controlsource of the text box which you want to display the phone number.

shay :cool:

Markatthepub
01-10-2003, 07:54 AM
even better Shay - thanks Mark