• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

Adding Run Query to Context Menu Access 2010

I have a form in Access 2010 which is used for Timetable planning in a college. When assigning teaching staff to a particular slot it is useful for the planner to know how many periods that member of staff is already assigned to.
I've written a query which will list members of staff and the number of periods which they are teaching, but I would like for the user to be able to right click on a period and run the query filtered by the member of staff in the relevant period. For example, RDR is teaching a Maths class in period 1, so his initials are in the text box for period 1. The user right clicks on the period 1 text box, and selects "Query teacher" and this opens the query filtered for RDR.

How easy is this to do?
0
Karl_mark
Asked:
Karl_mark
  • 4
  • 2
1 Solution
 
Jeffrey CoachmanCommented:
Right click menus are more difficult to create.

Why not just run this by clicking a button? (Much simpler)
0
 
Jeffrey CoachmanCommented:
or simpler, display the results in a popup form in a listbox (to disallow edits)
0
 
Karl_markAuthor Commented:
I've done that bit. It would just be nice to be able to right click and open the query!
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Jeffrey CoachmanCommented:
Then something like this should work in the most basic sense
Database107.mdb
0
 
Jeffrey CoachmanCommented:
ooops, you wanted the right click...
...as I stated, these are trickier to make in Access 2010...

Let's see if another expert chimes in...
0
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
You can use VBA code to do what you want.

Attached is an example in 2003 format that will work in 2007 and later. It will show you how to do what you want.
ShortcutDemoForPosting-A2003.zip
0
 
Karl_markAuthor Commented:
Thanks. Looks like it does the job and I can work it out!
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now