[AccessD] Access 2007 Report - Buttons Quit Working

Rocky Smolin rockysmolin at bchacc.com
Thu Apr 11 18:46:29 CDT 2013


Swapping in the report fixed the problem of the buttons on the form?  Odder
and odder.

I long ago gave up trying to understand Access internally and treated it as
a block box.  If the correct light on one side of the box lighted when I
pressed the right button on the other side, that was enough for me. :)

R 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Thursday, April 11, 2013 2:36 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working

Rocky,

Here is what I did...

(1) Deleted the wayward Report from the "Primary" accdb file.

(2) Copied the report from a backup copy of the accdb file and pasted it
into the Primary accdb file.

This fixed the problem. 

However, I have never seen this problem occur before and I would like to
better understand what I did to cause it. 

Brad
 

 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Thursday, April 11, 2013 4:35 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working

Practical matter to copy the existing buttons and recreate the code?

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Thursday, April 11, 2013 2:25 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working

Rocky,

I have created a new button on the report and the creation of an on-click
event works perfectly.

It appears that all of the original buttons are messed up, but new ones work
fine.

Brad

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Thursday, April 11, 2013 4:20 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working

Odd.  What happens if you create a new button and try to create an on-click
event?

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Thursday, April 11, 2013 1:37 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working

Rocky,

I kept a copy of the "bad" accdb file to experiment with.

I did as you suggested.  The results were the same as before.

When the VBA window is opened, I do NOT see something like...

~~~~~~~
Private Sub Command99_Click()

End Sub
~~~~~~~~


But instead I see

~~~~~~~
Option Compare Database
Option Explicit
~~~~~~~


This problem occurs on all original buttons on the report.

If I add a new button, things work properly.

Thanks again for your ideas and help.

Brad  




-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Thursday, April 11, 2013 2:18 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working

Brad:

Instead of right clicking the button, double click so you get the property
sheet.  Then go to the Events tab on the property sheet and follow the rest
of my suggestion.

Events Tab-->On Click Event-->Drop down combo box and select [Event
Procedure]--->click builder button to the right (button with the three
dots).  Then it will flip to the VBA page and you'll see the Private Sub and
End Sub lines.  Paste your copied code in there.

Rocky

 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Thursday, April 11, 2013 11:37 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working

Rocky,

Thanks for the assistance.

I followed the steps that you suggested.

When I Right Click on one of the buttons, select "Build Event", then select
"Code Builder" the VBA Window is opened.  The catch is that normally it
would open up to something like this ...




Private Sub Command99_Click()

End Sub





However, when the VBA Window is opened, it shows



Option Compare Database
Option Explicit




Which is at the top of the heap.


I added a brand new button and things worked nicely.

It appears that I have a very messed up report.

I deleted the Report and then copied it in from a backup copy of the accdb
file.
This fixed the problem with the buttons.

I am still puzzled about this problem because I have not worked with this
report for many weeks.

I guess that I may have angered the "Access Report gods"  :-)

Thanks again for your ideas and insights.

Brad 

 





-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Thursday, April 11, 2013 8:37 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working

Brad:

After you copy the event code (excluding the Private Sub and End Sub
lines)
delete the event code (including the Private Sub and End Sub lines) you will
need to recreate it.

Display the property sheet for the button (right click button, select
Properties)-->Events Tab-->On Click Event-->Drop down combo box and select
[Event Procedure]--->click builder button to the right (button with the
three dots).  Then it will flip to the VBA page and you'll see the Private
Sub and End Sub lines.  Paste your copied code in there.

HTH

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Thursday, April 11, 2013 5:32 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working

Rocky,

I tried the steps that you suggested (copy out the code, delete the module,
and recreate it, pasting back the code).

When I try to recreate the code, the VBA editor is opened, but it is not
showing the buttons Click event but it is showing code for another button.

I am not sure how things work behind the scenes, but it appears that the
"links" between the buttons on the report and the VBA code are messed up.

Thanks for your help.

Brad 


-----Original Message-----
From: accessd-bounces at databaseadvisors.com on behalf of Rocky Smolin
Sent: Wed 4/10/2013 7:33 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access 2007 Report - Buttons Quit Working
 
How about if you copy out the code, delete the module, and recreate it,
pasting back the code?


Rocky
 


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
This message was scanned by ESVA and is believed to be clean.
Click here to report this message as spam. 
http://h0stname/cgi-bin/learn-msg.cgi?id=B440E289AF.DB614



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
This message was scanned by ESVA and is believed to be clean.
Click here to report this message as spam. 
http://h0stname/cgi-bin/learn-msg.cgi?id=2815628A47.427F4



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
This message was scanned by ESVA and is believed to be clean.
Click here to report this message as spam. 
http://h0stname/cgi-bin/learn-msg.cgi?id=8C950289AF.33663



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
This message was scanned by ESVA and is believed to be clean.
Click here to report this message as spam. 
http://h0stname/cgi-bin/learn-msg.cgi?id=A9CCB289AF.6A8F1



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list