Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 2nd, 2006, 05:39 PM
Authorized User
 
Join Date: Sep 2006
Location: , , Australia.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error On Load and On Click

Hi all,

The first form that comes up on my app has an On Load event. but when my app starts i get an error msg saying :

"The expression On Load you entered as the event property setting produced the following error : Variable Not Defined

* 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 dont understand this as it was all working fine when i last closed it???

any help or explanation would be much appreciated

thankyou

  #2 (permalink)  
Old November 2nd, 2006, 06:34 PM
Authorized User
 
Join Date: Sep 2006
Location: , , Australia.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think it might have something to do with the fact that in my VBA Window the property section is empty even when i click on a form to add code?????

how do i get my properties back?

  #3 (permalink)  
Old November 2nd, 2006, 09:51 PM
Authorized User
 
Join Date: Sep 2006
Location: , , Australia.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok.... all ok now, but i have no idea what i did. everything seems to be working fine again. but if anyone has any idea why it did it in the first place i would still like to know

cheers


  #4 (permalink)  
Old November 3rd, 2006, 08:34 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Access is not very rigorous about how it passes error messages. If there is ANY code on the form where Access does not understand any word or thing you typed, it will through this error, even though the On Load event was not the source of the bad code.

So if you had a button on the form, wrote some code for it, then deleted the button, you have to delete the code for its events as well, or you will get a similar error the first time ANY event fires on the form.

Access checks ALL the code associated with an object when ANY code is run on the object.

mmcdonal


Similar Threads
Thread Thread Starter Forum Replies Last Post
error at reportDocument.Load akhilvira Crystal Reports 0 April 10th, 2007 12:00 AM
Error during load neetagp_21 Beginning VB 6 0 February 21st, 2007 02:16 AM
on the click of a button how to load another form? amit_mande@yahoo.com VB.NET 2 September 12th, 2006 06:53 AM
Guid Error in listview click event Jimson BOOK: Beginning VB.NET Databases 9 February 16th, 2006 01:57 PM
How to load 6 diff html pages with 1 mouse click bekim Javascript How-To 13 January 23rd, 2005 08:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.