Solved

MS Access 2003 build buttons from table with VBA?

Posted on 2013-01-18
3
254 Views
Last Modified: 2013-01-18
I have a table that has 5 or 6 items in it

On a form I want to dynamically create buttons (vertically)

Assign vba events (save text to SQL table) actions to the dynamicallly created buttons.
0
Comment
Question by:lrbrister
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 38793498
0
 

Author Closing Comment

by:lrbrister
ID: 38793521
That'll do it!
Thanks...as always
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38793576
Rather than building buttons dynamically (bad idea), I would suggest you create a continuous subform that contains a textbox associate with each record.

1.  Format this textbox by setting its SpecialEffect to raised, and BackColor to System Button Face.
2.  Use the GotFocus event of the button to move the focus to another control on the form (use a dummy textbox with zero width, and backstyle = transparent if you need to).  Also in the GotFocus event, execute whatever it is you want to do by using the Eval() function.

In my example, I display the action that I want to take in the textbox to the right of the "button".  As you can see, you can even pass the name of a function using this technique.
BuildButtons.mdb
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

831 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