I tried some of the examples found in posts here and perhaps I'm not understaning or am missing something as none of the suggestions have worked for me.
I have a combo box (which is replacing numerous buttons on the form) and the user selects the item then the code will call the sub that previously was activated by the button.
What I was hoping would happen is the following: User clicks on combobox, chooses tglEdit, code would then do a Call tglEdit_Click
I know I can use if or case statements, but thought that since each one is merely going to call an existing procedure I hoped it could have been done with one or two lines
Below are the different combinations I tried and each one gave an error such as can't find the procedure. (Please don't say "I see you have two stCall" as there will only be on, it's just I was commenting out one or the other, etc to see if that made a difference.)
I have a combo box (which is replacing numerous buttons on the form) and the user selects the item then the code will call the sub that previously was activated by the button.
What I was hoping would happen is the following: User clicks on combobox, chooses tglEdit, code would then do a Call tglEdit_Click
I know I can use if or case statements, but thought that since each one is merely going to call an existing procedure I hoped it could have been done with one or two lines
Below are the different combinations I tried and each one gave an error such as can't find the procedure. (Please don't say "I see you have two stCall" as there will only be on, it's just I was commenting out one or the other, etc to see if that made a difference.)
Code:
Private Sub cboCombo_Click()
'Replaces buttons for editing, adding records and opening forms
'20140424 ss
Dim stCall As String
'stCall= Me.cboCombo
'stCall = Me.cboCombo.Text '& "_Click()"
'CallByName Me, stCall, VbMethod
'Application.Run stCall & "_Click()"
'Application.Eval stCall
'Call stCall
End Sub