R
RyanH
I have a worksheet with several buttons on it. When each button is clicked
the associated custom userform is shown for the user to enter data. Is there
a way to pass the buttons caption or something to the procedure below when
the button is clicked so that the button can be identified thus calling the
appropriate userform?
Can this be done with a Forms Button and/or ActiveX Button? Thanks!
' in a standard module
Sub ShowUserforms(btnName As String)
On Error GoTo ErrorHandler
Select Case btnName
Case "Plastic Faces": frmPF.Show
Case "Aluminum Faces": frmAF.Show
Case "Flex Faces & Other Graphics": frmDigitalPrints.Show
Case "Tri Face Graphics": frmTriGraphics.Show
End Select
Exit Sub
'***********************************
ErrorHandler:
strPrompt = "An error has occured. Please make a note of what sequence
of clicks you made and contact Adminstrator."
strPrompt = strPrompt & vbNewLine & vbNewLine & "Location: " & SubName
& vbNewLine
strPrompt = strPrompt & Err.Number & "; " & Err.Description
MsgBox strPrompt, vbCritical, "Problem"
End Sub
the associated custom userform is shown for the user to enter data. Is there
a way to pass the buttons caption or something to the procedure below when
the button is clicked so that the button can be identified thus calling the
appropriate userform?
Can this be done with a Forms Button and/or ActiveX Button? Thanks!
' in a standard module
Sub ShowUserforms(btnName As String)
On Error GoTo ErrorHandler
Select Case btnName
Case "Plastic Faces": frmPF.Show
Case "Aluminum Faces": frmAF.Show
Case "Flex Faces & Other Graphics": frmDigitalPrints.Show
Case "Tri Face Graphics": frmTriGraphics.Show
End Select
Exit Sub
'***********************************
ErrorHandler:
strPrompt = "An error has occured. Please make a note of what sequence
of clicks you made and contact Adminstrator."
strPrompt = strPrompt & vbNewLine & vbNewLine & "Location: " & SubName
& vbNewLine
strPrompt = strPrompt & Err.Number & "; " & Err.Description
MsgBox strPrompt, vbCritical, "Problem"
End Sub