Access 2016 VBA Event Errors (1 Viewer)

Papashep

New member
Local time
Today, 22:28
Joined
Oct 13, 2013
Messages
15
Hi
This problem is driving me crazy.
I have a simple tabular form showing two records, it is setup so you can only input data into one field for each record.
I have created a simple on Click Event:
Option Compare Database
Option Explicit
---------------------------------------------------------
Private Sub LoginPassword_Click()
MsgBox (" On click of login password ")
End Sub

When I click on the field I get the error:
Invalid procedure call or argument

There are no other vba procedures in the database, so why am I getting this error? It happens on all of the procedures that I try to create.
:banghead:
 

jdraw

Super Moderator
Staff member
Local time
Today, 17:28
Joined
Jan 23, 2006
Messages
15,394
What exactly are you trying to accomplish?
You have shown us HOW you have tried to do something, but readers need to know what you re trying to do. There may be options.

This free video by Steve Bishop may be helpful.
 

Ranman256

Well-known member
Local time
Today, 17:28
Joined
Apr 9, 2015
Messages
4,337
msgbox does NOT use parenthesis UNLESS you want to return values.

just use
MsgBox "on click of login password"

(no parens)
 

Papashep

New member
Local time
Today, 22:28
Joined
Oct 13, 2013
Messages
15
Hi

In the example given all I am trying to do is display a message box using the on click vba event.
The error I am getting happens on all vba procures that I create and I don't know why.
I have tried to use a simple event example to see if I can get that to work and I have failed. I am looking for a reason why rather than another solution.
 

Papashep

New member
Local time
Today, 22:28
Joined
Oct 13, 2013
Messages
15
Hi
I tried your solution, but I still get the same error.
Thanks for your help.
 

JHB

Have been here a while
Local time
Today, 23:28
Joined
Jun 17, 2012
Messages
7,732
Hi

In the example given all I am trying to do is display a message box using the on click vba event.
The error I am getting happens on all vba procures that I create and I don't know why.
I have tried to use a simple event example to see if I can get that to work and I have failed. I am looking for a reason why rather than another solution.
How about other databases, are you able to run VBA-code in them?
 

Cronk

Registered User.
Local time
Tomorrow, 07:28
Joined
Jul 4, 2013
Messages
2,774
Have you tried the following?

compile/Debug
Compact/Repair
 

Papashep

New member
Local time
Today, 22:28
Joined
Oct 13, 2013
Messages
15
Repairing the database has resolved my problem.

Thanks to all who took time to help me.:)
 

Users who are viewing this thread

Top Bottom