Print Button "Stuck"

bearcub

Well-known Member
Joined
May 18, 2005
Messages
701
Office Version
  1. 365
  2. 2013
  3. 2010
  4. 2007
Platform
  1. Windows
I have a form where I have 12 buttons that print a different report. I'm having difficulty to open the first report when the form is opened (initialized).

It seems that when i first open the database (or form) the first button I press doesn't respond (it seems frozen and the print macro doesn't fire). I have to select another button (which fires that macro) and then come back to the first button to fire that macro. It seems that first macro is frozen when the form is opened - no matter which button has the initial focus.

Along these lines, when I open the form I would like a one button to be selected (i.e. have the focus on that button). I'm thinking that I could include the macro on the form open event (like you would in Excel when the workbook is opened). Is this possible to do?

Thank you for your help.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Too many buttons IMHO. A better way is to have a reports list (table) and base a combo on it. You add a report tomorrow, you add to the list, not put another button on a form!
Use either the AfterUpdate event of the combo to open the selected report, or if you want to be sure the correct one is selected, use one button to open the selected.
If sticking with the current way, try waiting a few moments to see if the problem is related to timing. Your form may be taking too long to open.
You can also turn on stepping in a macro and go one step at a time to see how things work, but I don't use macros and won't be of much help there.

To have any control have the focus when a form opens, set it's cycle property value to 0. Usually, that's done for a close button.
 
Upvote 0
Good idea about the list box and the selection. However, it is a static report so it won't change. That is a thought though. If it were changing I think I would have used that approach but that is something to think about, thank you.

I was trying to find the cycle property for the button but I couldn't see it anywhere. I see the cycle property on the Form (on the "other" tab) but not the button property sheet. Am I missing something?

Thank you for the help,

Michael
 
Upvote 0
Sorry, short circuit in memory bank. It is the Tab Order on Property sheet > Other tab as long as a control that can make use of it is the selected control. You can also right click...Build and get a list of all controls that have a setting so as to move the list around.
I still don't get why you have multiple buttons
12 buttons that print a different report
If any other soul wouldn't interpret this to mean that 12 buttons are used to open 12 different reports, then I dunno...
Maybe you're not understanding me.
 
Last edited:
Upvote 0
Thank you for the infomation. Are you referring to the Tab order? I've seen the cycle property but never investigated what it is or how it used.

I have the 12 buttons because all we are going to do is print the reports for Leadership directors. I have Excel linked to Access because we have information coming from different systems. So instead of slicing and dicing the data in Access I thought it would be quicker if the Admins did all the work in Excel since the source data is coming from Excel. This might not be the best approach though I did try putting all the data in local tables but found the updates to be rather laborious at times.

You're comments about the combo box (or list box) I've used on a userform in Excel to navigate through an Excel workbook. Presentation wise I thought that the buttons (their are only 12 buttons, 11 for dividual reports and one that includes all of them). I might end up doing as you suggest. We would only use this DB once a year so i thought the buttons would be okay for that purpose. If it were used everything then I would definitely reconsider, especially if you're adding more reports. They've been running these reports for years and the # hasn't changed.

Michael
 
Upvote 0
I think the reference was to the tab order. Is your button still "stuck"? This isn't normal or expected behavior but sometimes just a little trial and error can be used to sort it out (i.e., just anything you can think of - change tab order, delete and recreate button, check for open events and timing issues, run some other stupid do-nothing macro first, etc. etc. etc.)
 
Upvote 0
Thank you for asking. i think the issue might be that when the form opens the first report (the report that I really want to show) opens with the userform. Is this normal? Or , did I do something wrong in setting the macro.

What I just noticed is that there is a 3 or 4 second time delay after I press one of the buttons before the report opens. I do have an Excel file open with a number of array formulas which might be causing the issue. Do you this might be the problem? I haven't really tried to open the reports without the Excel file open.

These two thing things might be causing the issue (the report all ready being open and the Excel file being open). When I click on a button it closes the report that was previously opened so I won't have one report open than a time.

Michael
 
Upvote 0
All things being equal I would probably be putting timing issues at the top of the list. If you don't have any reports opening automatically then it might run faster. If its actually setting up a connection to an Excel file when the form opens that in itself can also take time.
 
Upvote 0
Ah, that might be it. All the tables are linked to Excel. So, as long as that is the issue I think I'm okay,

Thank you.

Michael
 
Upvote 0

Forum statistics

Threads
1,214,416
Messages
6,119,384
Members
448,889
Latest member
TS_711

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top