In sharing a Microsoft Access 2002 application across a Mac OS based network, I found that the server was arbitrarily assigning a Feb 2040 create date to the file, which was preventing the database files from being seen and backedup by our back up software. I believe this is because the database was created on my home computer and copied here.
To solve the issue, I created a new database in the office, and imported all the tables, forms, etc. into the new database, with a correct create date. Everything seems to be here, except I am getting a
"The visual basic module contains a syntax error" message, referring to the following "ModMain" module:
Option Compare Database 'Use database order for string comparisons
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
There also seems to be some involvement of an AutoExec Macro, which invokes the following InvMain() function.
Global dbApp As Database
Global AppUser 'Will hold the log on staff id
Function InvMain()
On Error GoTo Err_InvMain_Click
Dim username, result
'Set up the database
Set dbApp = CurrentDb()
username = GetAcUser()
AppUser = DLookup("Staff", "Staff", "Staff='" & username & "'")
If Not IsNull(AppUser) Then
'Opens the appropriate startup menu for the logged in user
DoCmd.OpenForm "General Manager"
GoTo Exit_InvMain
Else
CurrentDb.Execute "INSERT INTO Staff(Staff, FirstName) VALUES(" & Chr(34) & username & Chr(34) & ", " & Chr(34) & username & Chr(34) & ")"
AppUser = username
DoCmd.OpenForm "General Manager"
End If
Exit_InvMain:
Exit Function
InvMain = True
Err_InvMain_Click:
MsgBox Error$
End Function
Start Free Trial