?
Solved

MS Access 2003 build buttons from table with VBA?

Posted on 2013-01-18
3
Medium Priority
?
259 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
[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 Comments
 
LVL 120

Accepted Solution

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

Author Closing Comment

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

Expert Comment

by:Dale Fye
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

800 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