On Click error

  • Thread starter Brenda from Michigan
  • Start date
B

Brenda from Michigan

Access 2003 SP3

User reports nothing changed recently but now (the past 2+ weeks) she is
continually getting the following error message:
"The expression On Click you entered as the event property setting produced
the following error: Automation error Unspecified error. The expression may
not result in the name of a macro, the name of a user-defined function, or
[Event Procedure]. There may have been an error evaluating the function,
event, or macro."

I don't find anything useful in the MS KB. Can anyone offer any suggestions
on what is happening? Thanks!
 
M

Maarkr

Did u try going to design mode and selecting the command button to see what
is in the properties box for the On Click event? It should either have the
name of a macro or a function, or may say [event procedure], in which case
you want to highlight the line and click the elipses (...) on the right.
That will take you to the VB window and you can view the code that runs when
you click the button. Let us know what you see.
 
B

Brenda from Michigan

The On Click Properties shows [Event Procedure]

The coding after the ... is as follows, and I don't understand a word...
:-(

Private Sub OpenDMB925_Click()
On Error GoTo Err_OpenDMB925_Click

Dim atDocName As String
Dim atLinkCriteria As String

atDocName = "SecureIDNewRequest"
DoCmd.OpenForm atDocName, , , atLinkCriteria

Exit OpenDMB925_Click:
Exit Sub

Err_OpenDMB925_Click:
MsgBox.Err.Description
Resume Exit_OpenDMB925_Click

EndSub


Maarkr said:
Did u try going to design mode and selecting the command button to see what
is in the properties box for the On Click event? It should either have the
name of a macro or a function, or may say [event procedure], in which case
you want to highlight the line and click the elipses (...) on the right.
That will take you to the VB window and you can view the code that runs when
you click the button. Let us know what you see.

Brenda from Michigan said:
Access 2003 SP3

User reports nothing changed recently but now (the past 2+ weeks) she is
continually getting the following error message:
"The expression On Click you entered as the event property setting produced
the following error: Automation error Unspecified error. The expression may
not result in the name of a macro, the name of a user-defined function, or
[Event Procedure]. There may have been an error evaluating the function,
event, or macro."

I don't find anything useful in the MS KB. Can anyone offer any suggestions
on what is happening? Thanks!
 
M

Maarkr

this line may need fixed:
Exit OpenDMB925_Click:
should be Exit_OpenDMB925_Click:
note the underscore after Exit

it's trying to open the form 'SecureIDNewRequest'

can u find the form and open it from the database window (F11, Forms)?

Brenda from Michigan said:
The On Click Properties shows [Event Procedure]

The coding after the ... is as follows, and I don't understand a word...
:-(

Private Sub OpenDMB925_Click()
On Error GoTo Err_OpenDMB925_Click

Dim atDocName As String
Dim atLinkCriteria As String

atDocName = "SecureIDNewRequest"
DoCmd.OpenForm atDocName, , , atLinkCriteria

Exit OpenDMB925_Click:
Exit Sub

Err_OpenDMB925_Click:
MsgBox.Err.Description
Resume Exit_OpenDMB925_Click

EndSub


Maarkr said:
Did u try going to design mode and selecting the command button to see what
is in the properties box for the On Click event? It should either have the
name of a macro or a function, or may say [event procedure], in which case
you want to highlight the line and click the elipses (...) on the right.
That will take you to the VB window and you can view the code that runs when
you click the button. Let us know what you see.

Brenda from Michigan said:
Access 2003 SP3

User reports nothing changed recently but now (the past 2+ weeks) she is
continually getting the following error message:
"The expression On Click you entered as the event property setting produced
the following error: Automation error Unspecified error. The expression may
not result in the name of a macro, the name of a user-defined function, or
[Event Procedure]. There may have been an error evaluating the function,
event, or macro."

I don't find anything useful in the MS KB. Can anyone offer any suggestions
on what is happening? Thanks!
 
T

Tom Wickerath

Hi Brenda,

The code you show is typical wizard-created code. While it is not the
cleanest code, it should work okay, although you seem to be missing an
underscore as previously pointed out in the label "Exit OpenDMB925_Click:".

I suspect that you either have a missing reference error, or some other
compile-time error. Open any code module. Click on Tools | References. Are
any references marked as "MISSING"? If so, follow the instructions in these
two documents to help resolve missing reference errors:

Solving Problems with Library References (Allen Browne)
http://allenbrowne.com/ser-38.html

Access Reference Problems (Doug Steele)
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html

Note: As Doug points out in his article, you may still need to refresh the
references listing by selecting a new reference, clicking on the OK button to
dismiss the References dialog, and then going back in and deselecting the new
reference that you just selected.

After closing the References dialog, click on Debug | Compile {ProjectName}
where {ProjectName} is the name of your VBA project. You should not get any
compile errors. If you do, these should be fixed first.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top