Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-05-2013, 07:27 PM   #1
gblack
Newly Registered User
 
Join Date: Sep 2002
Location: VA USA
Posts: 632
Thanks: 8
Thanked 14 Times in 14 Posts
gblack is an unknown quantity at this point
On Click event procedure skipping the On CLick code

So I have this Application that was made by another devloper. There's a button on a form with an On Click event attached to it. The only issue is when I put a break point ANYWHERE in the code... then go back and click the button. It doesn't break.

Additionally, some code runs, because the button actually does stuff... just not the stuff in the On Click event.

I've never seen this before. I showed it to another developer and we're both kind of baffled as to how it would run.

I would post it, but unfortunately I can't for security reasons. So... I was wondering if anyone knew of a way to have the On Click event of a button do something other than what the code in the click event is denoting it should be doing.

As an aside, the On Click event is supposed to set the data up to be pushed as a report. So when I press the button it is pushing data as a report, it just happens to be the wrong data.

She does have some Macros set up... but the event procedure is listed in the properties under ON Click... not macros... but I was thinking maybe the Macros could override it...? I don't... I am kind of grapsing atm.

Of course... any help... greatly appreciated!

gblack is offline   Reply With Quote
Old 05-05-2013, 07:49 PM   #2
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,392
Thanks: 88
Thanked 1,650 Times in 1,532 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: On Click event procedure skipping the On CLick code

The only time I've ever seen something like that was when somehow the code in question wasn't properly linked to the button. It happened when the button got renamed and then was renamed a second time back to the original name, but by that point the damage was done. Except... the solution was simply to open the form in design view, select the button, bring up the property sheet to the event page, and click the OnClick event to verify that it was set for "[Event Procedure]" - and then double click that property so as to bring up the code associated with the event. That sequence relinked the OnClick event to the code.

That's the ONLY time I've ever seen that. But if the code in question seems to be working, I wonder if you have been looking at an entry point name tainted by a spelling error or something like that. In other words, looking at old code when code exists for a different name.

Yes, it is a long shot. But it might explain the facts.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 05-06-2013, 12:31 AM   #3
AlexHedley
Newly Registered User
 
Join Date: Aug 2012
Location: England
Posts: 171
Thanks: 0
Thanked 28 Times in 27 Posts
AlexHedley is on a distinguished road
If you import the form into another blank new database does it act strangely there too?

__________________
Alex Hedley
TechHelp Team Leader

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
AlexHedley is offline   Reply With Quote
Old 05-06-2013, 07:28 AM   #4
gblack
Newly Registered User
 
Join Date: Sep 2002
Location: VA USA
Posts: 632
Thanks: 8
Thanked 14 Times in 14 Posts
gblack is an unknown quantity at this point
Re: On Click event procedure skipping the On CLick code

Actually what happened is (unbeknownst to me) there were several possible Child/subforms that all look the exact same, which can be actived, based upon the choices one makes in the Parent/Main Form. The button in question is location on the subform.

So when I pulled up the main Form in design mode... the default subform appears. I put breaks on that Subform button's event procedure... Then ran the main form, but I didn't choose the correct option in the main form, so the underlying subquery would be different, although looking exactly the same as the subform I was trying to add breakpoints to.

Thusly I was clicking the button and things happened, instead of hitting an immediate breakpoint.

gblack is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I simulate a click event via code? David Anderson Forms 11 02-21-2010 07:59 AM
DoFocus Click Event Procedure Problem Johnrg Forms 2 08-13-2009 12:47 AM
macro to run on click event procedure Mike Hughes Macros 0 03-10-2009 12:01 PM
Stop a procedure from running with a click event ajetrumpet Modules & VBA 5 02-17-2008 12:34 PM
On Click Event Procedure Problem jereece Modules & VBA 3 10-13-2006 09:34 AM




All times are GMT -8. The time now is 11:02 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World