I have the following module
Function Roundtime(pTime As Variant) As Date
Dim thold As Date
'allows user to input either a valid time or a string
thold = TimeValue(pTime)
Roundtime = CDate(CDbl(CInt(CDbl(thold) * 96)) / 96)
End Function
I attached it to the form, on the lnghour field
Private Sub Hours_BeforeUpdate(Cancel As Integer)
If Not Roundtime(Me.LngHours) Then
MsgBox "what goes here?"
Cancel = True
the error messag is Expected variable or procedure, not module
what am I doing wrong?
Function Roundtime(pTime As Variant) As Date
Dim thold As Date
'allows user to input either a valid time or a string
thold = TimeValue(pTime)
Roundtime = CDate(CDbl(CInt(CDbl(thold) * 96)) / 96)
End Function
I attached it to the form, on the lnghour field
Private Sub Hours_BeforeUpdate(Cancel As Integer)
If Not Roundtime(Me.LngHours) Then
MsgBox "what goes here?"
Cancel = True
the error messag is Expected variable or procedure, not module
what am I doing wrong?