Solved

Access 2010 VBA Enable Right Click for Form Filter

Posted on 2013-05-16
5
2,104 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 48

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This is about my first experience with programming Arduino.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now