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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress Error Message

Status
Not open for further replies.

Sydney1

Technical User
Jul 14, 2004
156
US
Good Morning,

I have a subform that is linked to a combo box on the master form. I want to be able to add a new record to the subform before there is a corresponding entry in the linked combo box on the main form. I am receiving an error message when I enter the first character on the subform that states "You can't assign a value to this object". Which makes perfect sense. I am attempting to suppress this error message, but all of my attempts have failed. I have tried to add code in the before insert event on the subform that if the error number is 0 then resume next, but am still receiving the error.

Any ideas on how to suppress this error would be greatly appreciated.


Thanks in advance,

Sydney
 
Have you tried the
On Error GoTo ErrSomething
....
.....
.....

......

ErrSomething:

if err.number = Somenumber then DoSomthing
 
Thanks for the reply.

I've tried to use error handling in several events on the subform, before insert, after insert, the form overall error event and the only event that appears to acknowledge the error is the before insert. But even after I trap the error in the before insert, I still get the error message. I'm not sure where else to trap the error.

Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top