Compile Error

Bumi66

New member
Local time
Today, 01:25
Joined
Jan 15, 2019
Messages
19
HI Everyone,

I have an access database that runs perfectly on one of my computers,
when I copy the file to another PC I get a compile error and it looks
like it's because I have an entry in a query : Date: Date()

Both PC's run the same Access 365 version 2309.

Please help

Thanks
 

Bumi66

New member
Local time
Today, 01:25
Joined
Jan 15, 2019
Messages
19
Solved !!

I followed "Computer Learning Zone on Youtube to add the sleep function


For some reason the module 2 wasn't copied to the other computer as it should

#If VBA7 Then
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal Milliseconds As LongPtr)
#Else
Public Declare Sub Sleep Lib "kernel32" (ByVal Milliseconds As Long)
#End If

Public Sub SleepSec(NumSec As Long, Optional AllowEvents As Boolean = True)
Dim X As Integer
For X = 1 To NumSec
Sleep 1000
DoEvents
Next
End Sub

after copying everything again it works on all of my computers w/o any problem
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:25
Joined
Sep 21, 2011
Messages
14,299
That has nothing to do with your original post?

What is Optional AllowEvents As Boolean for?, as it is not used?
 

Bumi66

New member
Local time
Today, 01:25
Joined
Jan 15, 2019
Messages
19
That has nothing to do with your original post?

What is Optional AllowEvents As Boolean for?, as it is not used?
I don't know what all this code does and he also says in the video that you don't have to understand what all this code does, at least it worked. I copied all that into a new module but for some reason it didn't copy the whole module to the other PC what was really weird since I copied the whole database.

This was the only line that I could find in the module in the copied database.

Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal Milliseconds As LongPtr

It works now
 

Users who are viewing this thread

Top Bottom