Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to force a control Update

Status
Not open for further replies.

tbac

Technical User
Jun 16, 2003
59
US
I have a control, 'Combo1' with an On-Update event that runs when the user enters something. But another control, 'Combo2' has an On-Update that changes Combo1. How can I force the Combo1 event to occur when Combo1 is updated by Combo2?
 
You can try including the code below, in your combo2 after update event, ater the code to update combo1. This should then call and run the Combo1_AfterUpdate

Code:
 Combo1_AfterUpdate 'this being the name of the event of your combo1_afterupdate

HTH's


Take it Easy
Man with one chopstick go hungry
 
I tried it and it still doesnt seem to recognize that Combo1 has been updated, or at least the event doesnt run
 
How are ya tbac . . .

Transfer the code in combo1 to a [blue]common routine[/blue], then call the common routine as necessary from either combo.

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Howzit

As an example this works...

Selecting 1 in cboOne will make field4 = "First". By changing cboTwo, the value in cboOne will change to 3, then the "cbo_AferUpdate" is then called.

Code:
Private Sub cboOne_AfterUpdate()
If Me.cboOne.Value = 1 Then
    Me.Field4 = "First"
Else
    If Me.cboOne.Value = 2 Then
           Me.Field4 = "Second"
    Else
           Me.Field4 = "Third"
    End If
End If

End Sub

Private Sub cboTwo_AfterUpdate()
Me.cboOne.Value = 3
cboOne_AfterUpdate
End Sub

Take it Easy
Man with one chopstick go hungry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top