Application crashing

namliam

The Mailman - AWF VIP
Local time
Today, 20:55
Joined
Aug 11, 2003
Messages
11,695
I have a very very very strange problem.... I have below code
Code:
Public Function Startup()
    
    DoCmd.Hourglass True
....
    
MsgBox "GetUser" ' Get this
    GetUserInfo  ' Crash here without getting User1
....
End Function

Public Sub GetUserInfo()
    Dim strWhere As String
    
    glEmpid = 0
MsgBox "User1"
    glUsername = fOSUserName()        'Computer Username (EMP_PCID)
.....
End Sub
Which is obviously a snipit from the "big thing". The thing is normaly the msgboxes are not there. But now they are as one of my customers is having problems... Well actually 3 of em.... A pile of other do not have the same problem.... and are happily using it....

Anyway what happens is this: The user(s) get the MsgBox "GetUser" then the application (in Access Run-time so cannot debug) crashes... without even getting to the User1 messagebox....

My guess is that the GetUserInfo call fails but for the life of me I cannot see the problem. The code compiles just fine (Debug=> Compile)

The GetUserInfo used to be a function, I thought maybe that was a problem so I changed it to a sub. Not the Issue.

As stated there are quite a number of happy users of this app, but for 3 it simply will not work... Most of the users have only Access Run-time, some have Full version.... But would not know what to do with it if their life depended on it.

Any one with any ideas?
 
I suggest that you use the Environ() function to grab information from the users computer.

msgbox Environ("UserName")
msgbox Environ("ComputerName")

Search the forum for there are a bunch of other Environ variables you can extract from the users computer.
 
Database was migrated long ago from 97... Never changed the routines...

But using them will not help... The problem is in calling the sub or the declaration somewhere...

It craps out BEFORE getting the 'msgbox "User1"' and after 'MsgBox "GetUser"' and I dont get the error.... Cannot fake it...

And I dont understand it. Between the 2 message boxes there is nothing special going on....

Greetz
 
Not sure what is going on. For the sake of argument, just try this and see what happens...
Code:
Public Function Startup()
    
    Screen.MousePointer = 11
        
    MsgBox "GetUser"
    MsgBox Environ("UserName")
    
    Screen.MousePointer = 0
    
End Function
 
It seems to have -misteriously- fixed "it self" dunno yet what changed where.... but ..... its fixed...

Thanx
 

Users who are viewing this thread

Back
Top Bottom