So I wanted to make a start/stop timer in Access 2016. I found this website with the code and instructions:
https://support.microsoft.com/en-us/kb/325238
My first issue was needing to convert the declaration to 64 bit. So I replaced:
with:
That fixed that problem. But then I started to get a compile error "Argument not Optional" for the StartStop click event, and highlighted was "getTickCount ()" shown in bold in this code:
I am not savy enough with VBA to figure out what is not optional and how to make it so. Any suggestions?
https://support.microsoft.com/en-us/kb/325238
My first issue was needing to convert the declaration to 64 bit. So I replaced:
Code:
[COLOR=inherit][FONT=Menlo]Private Declare Function GetTickCount Lib "kernel32" () As Long[/FONT][/COLOR]
with:
Code:
Private Declare PtrSafe Function getTickCount Lib "kernel32" Alias "QueryPerformanceCounter" (cyTickCount As Currency) As Long
That fixed that problem. But then I started to get a compile error "Argument not Optional" for the StartStop click event, and highlighted was "getTickCount ()" shown in bold in this code:
Code:
Private Sub btnStartStop_Click()If Me.TimerInterval = 0 Then
StartTickCount = [B]getTickCount()[/B]
Me.TimerInterval = 15
Me!btnStartStop.Caption = "Stop"
Me!btnReset.Enabled = False
Else
TotalElapsedMilliSec = TotalElapsedMilliSec + _
(getTickCount() - StartTickCount)
Me.TimerInterval = 0
Me!btnStartStop.Caption = "Start"
Me!btnReset.Enabled = True
End If
End Sub
I am not savy enough with VBA to figure out what is not optional and how to make it so. Any suggestions?