Updating Fields

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

I'm looking for a little help. I have a form and I want to update one field
based on another. Basically I want the form to automatically input a number
corresponding with another item. So:

A=1
B=2
C=3
D=4
E-3
Etc.

So when I enter A on part of the form, it will update a corresponding part
with 1, and so on. Any clues?
 
One option would be to use a Select Case statement in the After Update
event of the first control;

Private Sub ControlOne_AfterUpdate()

Select Case Me![ControlOne]
Case "A"
Me![ControlTwo] = 1
Case "B"
Me![ControlTwo] = 2
Case "C"
Me![ControlTwo] = 3
Case "D"
Me![ControlTwo] = 4
Case Else
'do nothing or code to do something else
End Select

End Sub

Depending on your particular circumstances, you may also need to duplicate
the code in the forms Current event.
 
Back
Top