Private Sub lblATM_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call ChangeLabelColor(Me.Name, "lblATM")
End Sub
Public Sub ChangeLabelColor(frmName As Form, strLabelName As String)
'Changes color of label so user know it was pressed
Dim ctl As Control
For Each ctl In frmName.Controls
If ctl.Name = strLabelName Then
ctl.BackColor = 2858687
End If
Next ctl
End Sub
ASKER
ASKER
ASKER
Public Sub ChangeLabelColor(ctlLabel As Label)
ctl.BackColor = 2858687
End Sub
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
Try using this instead:
Me!Name
And if that is the case, avoid using Name and other reserved words for fieldnames, etc.