Correct Code

  • Thread starter Thread starter DaveB
  • Start date Start date
D

DaveB

I have a form with 3 fields on it:
OFFICE
OFFICE NAME
CONTACT

When I select an option from the OFFICE drop box, I would
like certain information to automatically fill into fields
OFFICE NAME and CONTACT. I not sure where to put the field
names.

Is this the correct code?

Private Sub cboMyCombo_AfterUpdate()
If Not IsNull(Me.myCombo) Then
Me.Field1 = "Hello"
Me.Field2 = "Goodbye"
End If
End Sub

Thanks.
DaveB
 
Dave,

Assuming you want the user to see the changes you make to the other
controls, I suggest you put your code into the OFFICE control's Change event.
The event fires as soon as the user makes a selection.

Tom
 
Back
Top