B
Bill
I have a situation wherein one of a form's
(frmSermonSelect) command buttons
calls a sub in a general module. The On
Click event of the command button calls
the sub in the general module and passes
the name of the command button's control
I have two problems:
1) In the segment of code below, I hard-coded
the name of the control (cmdSManager) because
I couldn't figure out the syntax in using the
variable name "cmdName", as declared in the Sub
statement:
2) It seems I have to "repaint" the calling form
in order for the color and caption changes to
appear to the user. The syntax you see below
is wrong, but I don't know what it ought to be.
Public Sub SermonMgr(Optional cmdName As String)
..
(snip)
..
If Not IsMissing(cmdName) Then
Forms!frmSermonSelect.Controls!cmdSManager.ForeColor = ForeColorBlue
Forms!frmSermonSelect.Controls!cmdSManager.Caption = "Copying Sermon to
Back-up"
Forms!frmSermonSelect.Controls!cmdSManager.Repaint
End If
..
(snip)
..
(frmSermonSelect) command buttons
calls a sub in a general module. The On
Click event of the command button calls
the sub in the general module and passes
the name of the command button's control
I have two problems:
1) In the segment of code below, I hard-coded
the name of the control (cmdSManager) because
I couldn't figure out the syntax in using the
variable name "cmdName", as declared in the Sub
statement:
2) It seems I have to "repaint" the calling form
in order for the color and caption changes to
appear to the user. The syntax you see below
is wrong, but I don't know what it ought to be.
Public Sub SermonMgr(Optional cmdName As String)
..
(snip)
..
If Not IsMissing(cmdName) Then
Forms!frmSermonSelect.Controls!cmdSManager.ForeColor = ForeColorBlue
Forms!frmSermonSelect.Controls!cmdSManager.Caption = "Copying Sermon to
Back-up"
Forms!frmSermonSelect.Controls!cmdSManager.Repaint
End If
..
(snip)
..