Thread: Custom Button on Custom Toolbar
01-26-10, 19:40 #1Registered User
- Join Date
- Nov 2002
Unanswered: Custom Button on Custom Toolbar
This may sound like a nutty request (maybe I am thinking too vb.net) but does anyone out there know if it is possible to put a custom button on a toolbar that runs code? I am thinking that I could make a macro and put the code on the toolbar, but the problem that I am envisioning is how to capture the name of the currently opened report while doing so. I have code modules in place that allow for making a supplied report name into a PDF, and then emailing it. I was thinking that if I could make a generic email form, with To, From, CCs Subject, Message, etc on it that if I could put a bar for it that pulls the name of any currently opened report on it and emails it that that would be much more useful than dumping these fields on every pop-up form that I have in the application to open up reports. Maybe I am thinking too grand, outside the capabilities of Access. Basically, what I would like is to put a button on the toolbar which, when pushed, grabs the name of the currently opened report and sends it to a form which allows the entry of info for emailing, and then buttons for said emailing. I could be wrong, but I don't believe that access allows for code to be put behind toolbar items. Btw, I use a different custom toolbar for reports then for forms, so that is how I would restrict the use of this function to just reports. I thank you in advance for your time and your replies.
01-26-10, 20:43 #2Purveyor of Discontent
Provided Answers: 1
- Join Date
- Mar 2003
- The Bottom of The Barrel
You can create custom context menus, if that's what you mean.
You might have to fall back on evil global variables to store the report name for later use.oh yeah... documentation... I have heard of that.
*** What Do You Want In The MS Access Forum? ***
01-29-10, 00:18 #3Moderator
- Join Date
- Dec 2004
- Madison, WI
I think someone posted some neat code to put a menu bar on a form which let you make it specific to that form and you could code events off of the items selected. I found the menu bar to work a little easier than the tool bar but I'm sure it can work for the tool bar.Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)