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.
Const MaxButtons = 12
Dim CurrentPic(MaxButtons) As Long
Dim CurrentButton As Long
Dim AnimateButtons As Boolean
Private Sub ButtonClick(ButtNo As Long)
On Error GoTo ErrBClick:
DoCmd.Hourglass True
DoCmd.Echo False, "Opening Form ..."
Select Case ButtNo
Case 1:
DoCmd.OpenForm "Gen Client"
'etc ...
Case Else
Beep
End Select
DoCmd.Hourglass True
ExitBClick:
On Error Resume Next
lblWait1.Visible = False
lblWait2.Visible = False
DoCmd.Echo True
DoEvents
DoCmd.Hourglass False
Exit Sub
ErrBClick:
DoCmd.Echo True
MsgBox Err.DESCRIPTION
Resume ExitBClick:
End Sub
Private Sub SetButtonActive(ButtNo As Long)
Dim A As Long
If AnimateButtons Then
For A = 1 To MaxButtons
If A = ButtNo Then
If CurrentPic(A) <> 1 Then
Me.Controls("Butt" & CStr(A)).PictureData = ButtonActive.PictureData
CurrentPic(A) = 1
CurrentButton = ButtNo
End If
Else
If CurrentPic(A) <> 0 Then
Me.Controls("Butt" & CStr(A)).PictureData = ButtonInactive.PictureData
CurrentPic(A) = 0
End If
End If
Next A
End If
End Sub
Private Sub SetButtonPressed(ButtNo As Long)
Dim A As Long
If AnimateButtons Then
For A = 1 To MaxButtons
If A = ButtNo Then
If CurrentPic(A) <> 2 Then
Me.Controls("Butt" & CStr(A)).PictureData = ButtonPressed.PictureData
CurrentPic(A) = 2
CurrentButton = ButtNo
End If
Else
If CurrentPic(A) <> 0 Then
Me.Controls("Butt" & CStr(A)).PictureData = ButtonInactive.PictureData
CurrentPic(A) = 0
End If
End If
Next A
End If
End Sub
Private Sub SetAllButtonsInactive()
Dim A As Long
If AnimateButtons Then
For A = 1 To MaxButtons
If CurrentPic(A) <> 0 Then
Me.Controls("Butt" & CStr(A)).PictureData = ButtonInactive.PictureData
CurrentPic(A) = 0
End If
Next A
CurrentButton = 0
End If
End Sub
Private Sub Butt1_Click()
ButtonClick 1
End Sub
Private Sub Butt1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
SetButtonPressed 1
End Sub
Private Sub Butt1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Button And 1) = 1 Then
SetButtonPressed 1
ElseIf Button = 0 Then
SetButtonActive 1
End If
End Sub
Private Sub Butt1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
SetButtonActive 1
End Sub
Private Sub Form_Load()
Dim A As Long
AnimateButtons = Not IsTerminalServer() 'Declaration not included
For A = 0 To MaxButtons
CurrentPic(A) = 0
Next A
CurrentButton = 0
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
SetAllButtonsInactive
End Sub
Private Sub lblOption1_Click()
Butt1_Click
End Sub
Private Sub lblOption1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Butt1_MouseDown Button, Shift, X, Y
End Sub
Private Sub lblOption1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Butt1_MouseMove Button, Shift, X, Y
End Sub
Private Sub lblOption1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Butt1_MouseUp Button, Shift, X, Y
End Sub