Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub yourLabel_Click()
Dim strLabel As String
strLabel = Me.yourLabel.Caption
MsgBox strLabel
End Sub
Private Sub yourLabel_Click()
Dim strLabel As String
strLabel = Me.yourLabel.Caption
Application.FollowHyperlink strLabel
End Sub
Private Sub btn01_Click()
Dim ctrlName As String
ctrlName = "lbl" & Right(Screen.ActiveControl.Name, 2)
Me.Controls(ctrlName).BackColor = vbRed
Me.Controls(ctrlName).ForeColor = vbWhite
End Sub
Option Compare Database
Option Explicit
Const vbGray As Long = 12632256
Private Sub Command0_Click()
Dim lblTheLabel As Label
Set lblTheLabel = Me.Controls("Label" & Right(Screen.ActiveControl.Name, 1))
Call SetColor(lblTheLabel)
Set lblTheLabel = Nothing
End Sub
Private Sub Command1_Click()
Dim lblTheLabel As Label
Set lblTheLabel = Me.Controls("Label" & Right(Screen.ActiveControl.Name, 1))
Call SetColor(lblTheLabel)
Set lblTheLabel = Nothing
End Sub
Private Sub Command2_Click()
Dim lblTheLabel As Label
Set lblTheLabel = Me.Controls("Label" & Right(Screen.ActiveControl.Name, 1))
Call SetColor(lblTheLabel)
Set lblTheLabel = Nothing
End Sub
Sub SetColor(lblMyLabel As Label)
If lblMyLabel.BackColor = vbGray Then
lblMyLabel.BackColor = vbRed
lblMyLabel.ForeColor = vbWhite
Else
lblMyLabel.BackColor = vbGray
lblMyLabel.ForeColor = vbBlack
End If
End Sub
Option Compare Database
Option Explicit
Const vbGray As Long = 12632256
Private Sub Command0_Click()
Call ClickedButton
End Sub
Private Sub Command1_Click()
Call ClickedButton
End Sub
Private Sub Command2_Click()
Call ClickedButton
End Sub
Sub ClickedButton()
Dim lblTheLabel As Label
Set lblTheLabel = Me.Controls("Label" & Right(Screen.ActiveControl.Name, 1))
Call SetColor(lblTheLabel)
Set lblTheLabel = Nothing
End Sub
Sub SetColor(lblMyLabel As Label)
If lblMyLabel.BackColor = vbGray Then
lblMyLabel.BackColor = vbYellow
lblMyLabel.ForeColor = vbBlue
Else
lblMyLabel.BackColor = vbGray
lblMyLabel.ForeColor = vbBlack
End If
End Sub
Private Sub Command7_Click()
If Me!Label6.HyperlinkAddress <> vbNullString Then
Me!Label6.HyperlinkAddress = vbNullString
Else
Me!Label6.HyperlinkAddress = "[URL unfurl="true"]http://www.microsoft.com"[/URL]
End If
End Sub