Opening database problems (1 Viewer)

jd_boss_hogg

Registered User.
Local time
Tomorrow, 00:34
Joined
Aug 5, 2009
Messages
88
Hi All - hope some kind person can help a newbie....

I have a split dbase (front end / backend) which works well on the 4 or 5 systems it's installed on. It was written on 2003.

I have just copied it to a new users PC, but when i try to open the dbase i get a pop up saying " the expression On Load you entered as the event property " etc... basically, it wont do any of the "on load/open/timer" stuff that works perfectly well on other users computers.

I've set macro/security settings to LOW but cant think what else to do to fix it? I dont think it's a problem with the programming because this has been installed on maybe 10-20 computers in the last 10 years , all of which ran it with no problems.

The "on load", BTW, just opens the switchboard and sets up a few things.

Thanks for reading - and thanks if you can help !
 

Ranman256

Well-known member
Local time
Today, 18:34
Joined
Apr 9, 2015
Messages
4,337
This one is hard to track down. Ive gotten it before and it WONT break on the error.
Somewhere is a statement that the PC doesnt like. You could try looking in the VBE, TOOLS, REFERENCES.
It MAY give a clue if there's a MISSING object, or switch to an older version object.
 

jd_boss_hogg

Registered User.
Local time
Tomorrow, 00:34
Joined
Aug 5, 2009
Messages
88
Thanks, but i'm pretty convinced its a config or setting rather than a programming thing.

it falls at the first "on load" - if i rem that out, it then falls at the next "on open", if i rem that out it then falls at "on timer".... it basically wont do anything that is called ? But the exact same dbase works fine on every other computer we have tried it on ?
 

selvsagt

Registered User.
Local time
Tomorrow, 00:34
Joined
Jun 29, 2006
Messages
99
I used to get the same error. To fix it I decompiled, then compiled, and it worked every time. Thats just a quick fix though.

The reason for this error in my case was som faulty code, actually unrelated to the form that got corrupted.

Have you done anything at all with the frontend (like moving a control, or changed a title...etc). After small changes like that I got the error, and had to compile.

Does the splash screen have any vba code at all?
If not, check that HasModule is set to false in the forms properties.
 

jd_boss_hogg

Registered User.
Local time
Tomorrow, 00:34
Joined
Aug 5, 2009
Messages
88
Thanks Selvsagt.... but this isnt a code thing, its a system config thing. I have just copied the frontend onto 4 other computers, and works perfectly on all of them. There doesnt seem anything peculiar about the problem one, but it just wont run anything.....
 

spikepl

Eledittingent Beliped
Local time
Tomorrow, 00:34
Joined
Nov 3, 2010
Messages
6,142
The code thing can identify the system config thing. Do #2 then #4 - on the culprit machine
 

bikcina

Registered User.
Local time
Tomorrow, 00:34
Joined
Jun 3, 2015
Messages
15
I have similar problem, but I noticed same pattern like selvsagt explained. After small change application goes crazy. Sometimes everything is working well until I make .accde, and only on .accde I got errors like "the expression OnLoad/OnEvent/OnTimer you entered as the event property...", but sometimes it happens with .accdb also. Compiling usually isn't very helpful but decompile sometimes helps. When decomplie isn't helping I split database again put password on it and make again .accde file. In some cases I have to do this two or three times until everything starts working.

My first form is a Splash Screen which has some code in it
Splash screen code:
******
Option Compare Database
Option Explicit

Private Sub Form_Load()
On Error GoTo ErrorHandler

Dim strUserFullName As String
Dim strUsername As String
Dim rstUsers As Recordset2
Dim db As Database

Set db = DBEngine(0)(0)
Set rstUsers = db.OpenRecordset("tblUsers")

rstUsers.Close

strUsername = mod_UserManagement_GetUserNameOfCurrentlyLoggedInUser
strUserFullName = mod_UserManagement_GetUserFullName(strUsername)

If strUserFullName = USER_NOT_REGISTERED Then
'Allow registration of first user of type Administrator
If DCount("UserName", "tblUsers") = 0 Then
MsgBox "Application does not contain registered users. Please don't forget to register the user of type Administrator.", vbExclamation
lblFullUserName.Caption = ""
lblUsername.Caption = strUsername
Else
MsgBox "Sorry, you are not registered to use this application. Please contact Administrator for more details.", _
vbCritical
Application.Quit
End If
Else
lblFullUserName.Caption = strUserFullName
lblUsername.Caption = strUsername
End If

lblVersion.Caption = APPLICATION_VERSION

mod_Util_ChangeApplicationProperty "AppIcon", dbText, Access.CurrentProject.Path & "\logo.ico"

Exit Sub
ErrorHandler:
If MsgBox("Database cannot be found. Advanced Users press OK to link the tables. Otherwise, notify an admin and press cancel to close the application.", vbOKCancel) = vbOK Then
RunCommand acCmdLinkedTableManager
Else
DoCmd.Quit
End If

End Sub

Private Sub Form_Timer()
DoCmd.OpenForm "frmDashboard"
DoCmd.Close acForm, "frmSplashScreen"
End Sub

*****

Maybe it is important to mention that I have custom Ribbon in my application.

Is this normal behavior for Access or I'm making some mistake?

Thank you!
 
Last edited:

jd_boss_hogg

Registered User.
Local time
Tomorrow, 00:34
Joined
Aug 5, 2009
Messages
88
Sorry, i should have posted this reply to my original posting...... i found that if i ensured that everybody was out of their own copies of the front end, and therefore the backend wasnt being used by anybody, THEN we we took a copy of a frontend and pasted it to a new PC, it worked fine. Done this a few times since, and always works, so make sure every instance of people running the split database is closed.
 

Users who are viewing this thread

Top Bottom