Solved

Caption

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

785 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