Autofilling fields in a form...

A

ajayb

Hi all,

I have a form that lists a vehicle id, it's location and it's registration.
I have the vehicle id as a combo box. Can I get the form to automatically
fill in the location and registration when the vehicle id is selected? I'm
sure I've seen it in operation.

Thanks

Andy
 
A

Al Campagna

ajayb,
In your combo (ex. cboVehicle, bound to VehicleID) set up these columns...
VehicleID Location Registration

Place 2 unbound text controls on the form named txtLocation and txtRegistration.
= cboVehicle.Column(1)
and
= cboVehicle.Column(2)
These will always display the Location and Registration in column 1 and 2 of the combo
(combo cols are numbered 0,1,2,3...etc)

You do not need to, nor should you, "capture" the Location and Registration... just
"display" it. In any subsequent form, query, or report, you can re-derive the Location
and Registration "on the fly" using the related VehicleID...
 
A

ajayb

Thanks Al, that worked perfectly!

Andy

Al Campagna said:
ajayb,
In your combo (ex. cboVehicle, bound to VehicleID) set up these columns...
VehicleID Location Registration

Place 2 unbound text controls on the form named txtLocation and txtRegistration.
= cboVehicle.Column(1)
and
= cboVehicle.Column(2)
These will always display the Location and Registration in column 1 and 2 of the combo
(combo cols are numbered 0,1,2,3...etc)

You do not need to, nor should you, "capture" the Location and Registration... just
"display" it. In any subsequent form, query, or report, you can re-derive the Location
and Registration "on the fly" using the related VehicleID...

--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
Top