Hi
I have a piece of code that when executed off the back of a combo box changing it displays a Yes/No message box, however it isn't doing what I want it to do.
User selects combo box value, after update: message box appears asking if they want to add another area/team? User has yes or no, if user selects yes then it should enable a combo box below etc.
Code as follows:
Private Sub cboTeamCaused1_AfterUpdate()
'Me.cboAreaCaused2.Enabled = True
messagemore = MsgBox("Do you want to add another area/team?", vbYesNo, "Another?")
If (messagemore = vbayes) Then
Me.cboAreaCaused2.Enabled = True
ElseIf (messagemore = vbano) Then
Exit Sub
End If
End Sub
When executed nothing happens - if I put the me.cboAreaCaused2.Enable = True outside of the messagebox it works as expected.
I have tried adding a custom subroutine and then referencing that however that doesn't work.
Can anyone suggest an alternative? Other than not having the msgbox, as I want this to add to the user engagement etc.
Thanks
Carl
I have a piece of code that when executed off the back of a combo box changing it displays a Yes/No message box, however it isn't doing what I want it to do.
User selects combo box value, after update: message box appears asking if they want to add another area/team? User has yes or no, if user selects yes then it should enable a combo box below etc.
Code as follows:
Private Sub cboTeamCaused1_AfterUpdate()
'Me.cboAreaCaused2.Enabled = True
messagemore = MsgBox("Do you want to add another area/team?", vbYesNo, "Another?")
If (messagemore = vbayes) Then
Me.cboAreaCaused2.Enabled = True
ElseIf (messagemore = vbano) Then
Exit Sub
End If
End Sub
When executed nothing happens - if I put the me.cboAreaCaused2.Enable = True outside of the messagebox it works as expected.
I have tried adding a custom subroutine and then referencing that however that doesn't work.
Can anyone suggest an alternative? Other than not having the msgbox, as I want this to add to the user engagement etc.
Thanks
Carl