Solved

Access 2010 VBA Enable Right Click for Form Filter

Posted on 2013-05-16
5
2,142 Views
Last Modified: 2013-05-24
I've developed an access database for a friend; I've attached a stripped down version to focus on the area.  In the past when making access databases, I've like to hide all of the ribbons and database window from the user.  I think it looks a little more professional and sometimes has security reasons (for those who are honest and just like to play around with things they are not supposed to) in doing so.

For this application, however, I need to make the right click available so that the user can filter the database values based on the form.   If you hold shift down while opening the database, which in this case I want to allow, the toolbars and database window appear, you can open the form, and you can right click on the "title" field of the form and filter the data.

If you just double-click the application icon opening the database, the user can not filter the data.  I have a macro in the background shutting down all of the toolbars and the database window.  I have no idea however to skip the functionality to allow the form filter in this process.  

I'm sure this is a fairly easy fix, but 3 days of googling and revising the VBA has not yet been successful.  I realize now that I should have just asked here.
rightclickenabledneeded.accdb
0
Comment
Question by:atljarman
5 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 39170861
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 200 total points
ID: 39171466
< In the past when making access databases, I've like to hide all of the ribbons and database window from the user.  I think it looks a little more professional and sometimes has security reasons (for those who are honest and just like to play around with things they are not supposed to) in doing so.
>
The kicker here is that the Access database has to run "inside" the Access environment.
So all of the techniques to "Hide the application Window" have equally complex consequences.

My guess is that when you "Hide" the Access application window, you lose the ability to filter...?

What I do is just:
Minimize the ribbon
Hide the Nave Pane
Disable Full menus

Or why not just create your own filter system and make it part of the form, then this should be a non-issue.
0
 
LVL 75
ID: 39172008
"For this application, however, I need to make the right click available so that the user can filter the database values based on the form. "

In A2010, you have two options (neither satisfactory):
1)  Create your own custom Right Click menu (aka context aka PopUps) via VBA code using the CommandBars collection)

2) Create custom menus (right click, menu & tool bars) in A2003 first - using the Customize Dialog, then Import these into A2010. Custom menus will show up on the Add-Ins Ribbon, and Right Click will show up normally.
I've created 1000's of custom menus/toolbars/popups with the Customize Dialog - soooooo eash.

There is *no* built in tool in A2010 to create Right Click menus OR custom Ribbons for that matter.

This is the de-facto standard tool for creating custom Ribbons:

http://www.ribboncreator2010.de

I have this tool
0
 

Accepted Solution

by:
atljarman earned 0 total points
ID: 39178365
This is the filter form that I created.  I really didn't want to add a ribbon as I wanted to hide the database window from the user during data entry.  

On the filter form, I uppercased both the value entered and the query value.  I also changed the recordsource of the main form to the query string created in VBA (dynamically) based on the values selected/entered by the user.

I've added the example in case others get to this page and they have the same issue.  Thanks for your suggestions.
rightclickenabledneeded.accdb
0
 

Author Closing Comment

by:atljarman
ID: 39193688
Good ideas provided, but a working solution made available in the end so other users can download and repeat for their purposes as needed.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question