Solved

Caption

Posted on 2009-06-29
2
167 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 69

Accepted Solution

by:
Éric Moreau earned 500 total points
Comment Utility
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
Comment Utility
Thanks a lot sir!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now