Solved

Caption

Posted on 2009-06-29
2
173 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
[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
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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 …
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…
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…

733 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