cariobulog
Technical User
Anyone could help me how i can make my command button background color changing everytime i click it.
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.
DoCmd.OpenForm "YourFormNameHere"
Private Sub CommandButton1_Click()
Select Case Me.CommandButton1.BackColor
Case Is = vbGreen
DoCmd.OpenForm "Form1"
Case Is = vbBlue
DoCmd.OpenForm "Form2"
Case Is = vbRed
DoCmd.OpenForm "Form3"
End Select
End Sub
Private Sub CommandButton1_Click()
Select Case Me.CommandButton1.BackColor
Case Is = vbGreen
If MsgBox("Do you want to open a form?", vbYesNo, "Confirm") = vbYes Then
DoCmd.OpenForm "Form1"
End If
Case Is = vbBlue
If MsgBox("Do you want to open a form?", vbYesNo, "Confirm") = vbYes Then
DoCmd.OpenForm "Form3"
End If
Case Is = vbRed
If MsgBox("Do you want to open a form?", vbYesNo, "Confirm") = vbYes Then
DoCmd.OpenForm "Form2"
End If
End Select
End Sub