Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access Error Message...Help Please

Status
Not open for further replies.

herd

Technical User
Jun 23, 2003
46
0
0
US
I'm geting error messages when open my form.

The expression On Load you entered as the event property setting produced the following error: A problem occured while Microsoft Access was communicating with the OLE server or ActiveX Control.

Also same message but for on current.

Here's my code


Public Function WinName()
Me.username = GetWindowsUserName
End Function

Public Function Edit()
If Me!username = [tblpersonnel.username1] Then
AllowEdits = True
ElseIf Me.username = "martiscm" Then
AllowEdits = True
ElseIf Me.username = "larsong" Then
AllowEdits = True
Else: AllowEdits = False
End If
End Function

Also once I'm in the form, if I navigate to the next record I get the same message but it's for On click.

Help Gary
 
herd,

Quick check.. I believe your API call GetWindowsUserName is creating the error. Here are some suggestions.

Run it on a different machine. Did you get the same error? This may be related to a damaged or corrupted DLL.

Commnent out the API call (yes I know the security won't work) same error?

Also check out this link. Is your call simliar? Can you use this instead?


Just trying to "zoom" in on the problem.

Hope this helps..
 
Different Maschine - same error
Comment out - same error
used new code - same error.

My form would work for about 1 day (24 hours) then with know warning it would start getting this error message.
 
try changing

If Me!username = [tblpersonnel.username1] Then

to

If Me!username = [tblpersonnel].[username1] Then

PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top