Error message

J

Jet

This happens on one of my forms (not the others)

After I use the wizard to add a "go to next record" button, when I click on
it I get this message:

"The expression On Click you entered as an event property setting produced
the following error: Object or Class does not support the set of events"

I can add such button on all other forms I have but I can on one form.

the code associated with this is:

Private Sub Command38_Click()
On Error GoTo Err_Command38_Click


DoCmd.Close

Exit_Command38_Click:
Exit Sub

Err_Command38_Click:
MsgBox Err.Description
Resume Exit_Command38_Click

End Sub
 
J

John Vinson

This happens on one of my forms (not the others)

After I use the wizard to add a "go to next record" button, when I click on
it I get this message:

The code you post doesn't do a "go to record" operation - it just has
a line DoCmd.Close without specifying what it is that you want to
close. My guess is that it's defaulting to try to close the Button -
and a button doesn't have close or open events!

Try deleting the code, deleting the button, and recreating it using
the wizard.

John W. Vinson[MVP]
 
J

Jet

John,

You are correct, I was trying to add a "Close" button.

I tried to delete the code and buttons many times, I also tried deleteing
the code, deleting the button, closing access, re-opening and trying the
wizard: that didn't work either.

Thanks for taking the time to post a response, it is greatly appreciated.
 
J

John Vinson

John,

You are correct, I was trying to add a "Close" button.

The wizard must be having a bad week. <g>

Try adding some specificity:

Private Sub Command38_Click()
On Error GoTo Err_Command38_Click


DoCmd.Close acForm, Me.Name

Exit_Command38_Click:
Exit Sub

Err_Command38_Click:
MsgBox Err.Description
Resume Exit_Command38_Click

End Sub



John W. Vinson[MVP]
 
J

Jet

Great suggestion, but no luck, still getting the same error message.
The help reference on the error message to "Microsoft Knowledge Base article
283806, but in reading it I can seem to figure it out.

Any suggestions?
 
J

Jet

I was able to fix the problem (with the inspiration you provided).

I made a copy of the form, pasted it with a new name, deleted the old one,
renamed the new one with the old name...problem gone

Thank, take care and always think success

Jean
 
J

John Vinson

Great suggestion, but no luck, still getting the same error message.
The help reference on the error message to "Microsoft Knowledge Base article
283806, but in reading it I can seem to figure it out.

I presume you meant "can't"??

If the MSKB article is relevant, try:

Open any module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the .DLL
files required by Access will probably be marked MISSING. Uncheck it,
recheck it, close and open Access.

If none are MISSING, check any reference; close and open Access; then
uncheck it again. This will force Access to relink the libraries.

Use Tools... Database Utilities... Compact and Repair after doing
this.

You may also want to Decompile the database - sometimes there is
"garbage" code left and decompiling/recompiling can help. See

http://www.granite.ab.ca/access/decompile.htm for instructions and a
discussion.

John W. Vinson[MVP]
 

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