Populate value dependent upon previous field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table containing insurance types and the rate for each type.
On a form I have a combo to select one of the insurance types, then the next
field is for the relevant rate.
I would like the rate field to be populated automatically once the type has
been selected.
I have been trying to build code based on After Update but cannot get it to
work and I know this is a basic bit of work but it has been a long day here
(UK) and the brain is getting blunt - no doubt somebody can point me in the
right direction?
Many thanks
CW
 
I have a table containing insurance types and the rate for each type.
On a form I have a combo to select one of the insurance types, then the next
field is for the relevant rate.
I would like the rate field to be populated automatically once the type has
been selected.
I have been trying to build code based on After Update but cannot get it to
work and I know this is a basic bit of work but it has been a long day here
(UK) and the brain is getting blunt - no doubt somebody can point me in the
right direction?
Many thanks
CW

Bear in mind that I cannot see your form, have no idea what your
control names might be, nor what you've tried nor what problems you're
having... but:

Private Sub cboInsuranceType_AfterUpdate()
Me.txtRate = Me.cboInsuranceType.Column(2)
End Sub

will push the value from the third field (it's zero based) in the
combo box cboInsuranceType's row source into the textbox named
txtRate.

John W. Vinson[MVP]
 
Back
Top