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

form load issues

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I am receiving the following error:

The expression On Load you entered as the event property setting produced the following error: Member already exists in an object module from which this object module derives. 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 funciton, event or macro.

The only event related to my form is On_Load and all I have in the event is: MsgBox("Test"). Any ideas on why I am getting this error? Thanks!
 
Well, I copied and pasted the form and the new one works fine. Weird...
 
If I had of seen this earlier I would have posted before. I've noticed that if you go into the VBA editor and add your events manually the controllers will not be set up correctly and therefore the button or form that is linked to the event will not call your event correctly. In Access you MUST go to the event tab of properties for the control and add code to the event before moving to the VBA editor to write the code. Be glad you learned this on a form with one event. I had to rewrite a 10-page form when I learned about this bug.
 
I know that and on my wayward form, I had an event procedure marked for the form load event, but it still wouldn't run the code. It was the weirdest thing ever. Oh well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top