Expected variable or procedure, not module

teiben

Registered User.
Local time
Today, 22:45
Joined
Jun 20, 2002
Messages
462
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?
 
teiben,

Don't name the function the same as the Module.

Wayne
 
Please explain, I don't know how I'm doing that
 
What's the rest of the code for this sub as you have only detailed part of it?

Private Sub Hours_BeforeUpdate
 
code

There is nothing, I was trying to implement

Private Sub Hours_BeforeUpdate(Cancel As Integer)


Is it
 
Nothing?

Code:
If Not Roundtime(Me.LngHours) Then
MsgBox "what goes here?"
Cancel = True

You need to close that section with an End If statement.
 
the error messag is Expected variable or procedure, not module

I still get the error messag is Expected variable or procedure, not module

what am I doing wrong?
 
Upload it; something sounds dodgy and I don't think you're giving all the information.
 

Users who are viewing this thread

Back
Top Bottom