Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Caption

Posted on 2009-06-29
2
Medium Priority
?
186 Views
Last Modified: 2013-11-25
How can I improved the code below wherein I want to display in a textbox (txtIndex.text) each time that I press the command button?  Here's the scenario of the problem.. I have a 5(five) command button name Command1 their index are 100,101,102,103,104  Just in case I press the Command1(103)  I want to display in  a textbox(txtIndex.text) its index number within that command1. Is it Possible? If yes.. Please Help me . if no,  just tell me. Thanks
Private Sub Command1_Click(Index As Integer)
Dim i As Integer
For i = Command1.LBound To Command1.UBound
txtIndex.Text = Command1(i)
Next
End Sub

Open in new window

0
Comment
Question by:Whing Dela Cruz
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 24737296
You want to display just the Index?


Private Sub Command1_Click(Index As Integer)
   txtIndex.Text = Index
End Sub

Open in new window

0
 

Author Closing Comment

by:Whing Dela Cruz
ID: 31597959
Thanks a lot sir!
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

971 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