[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access:  Catch the cmd buton that was pushed

Posted on 2011-02-24
5
Medium Priority
?
352 Views
Last Modified: 2012-06-27
I have a alpha-numeric keyboard built in Access on a from.  Has letters and #'s and accounts for what language is selected so the caption changes.

I want to run the same SUB for each button and passing the value of the button.  I don't want to code each buttun with ....call perform_Search(xxx).

Is there a way to catch what button was pressed at a higher level...similar to in excel.
application.Caller

I have thought about an option group as a solution.

I want something like this:

: when form buttons are clicked
: check if the tag or something is that button
: get the value of the button
: pass to the search function.

tnx for the help
0
Comment
Question by:skillilea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 34972605
i would use an option group for this purpose, so you can easily pass the info to the function using the value of the option group in the afterupdate event of the option group

private sub optionGrp_afterupdate()

call perform_Search(me.optioGrp)

end sub

0
 

Author Comment

by:skillilea
ID: 34974266
Looks like I can only have 20 options in the group so would need two groups for sure.  

Access 2010.

hmmm...

0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34974911
i can place more than 30 options in an option frame without problem
i used toggle button instead of command button
0
 

Author Comment

by:skillilea
ID: 34975010
nice...I used the wrong type..

is there an easy way to add more buttons to the frame?  Can I just copy and paste in?

tnx
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34975293
<is there an easy way to add more buttons to the frame?  Can I just copy and paste in?>

yes, then just change the option values.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

656 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