Using array buttons

using visual Basic

How can i program an array button so that it can be used to enter text into a field as well as a number.

for example the number 2 button enters "2" into the field and also when requested can enter "A" or "B" or "C"
thank you
Matt_leeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Matt_leeAuthor Commented:
Edited text of question.
0
VbmasterCommented:
In the Click event you can check the value of the variable Index to see which button was pressed.
0
grooneCommented:
I think this is what you may want.
You are simply turning the information from the text box or what ever and turning it into a variant.
Then you figure the ascii value of the first character and it add or place next to one another.

Private Sub Command2_Click()
    Dim tmp As Variant, tmpAsc As Integer
       
    tmp = CVar(Text1.Text)
    tmpAsc = Asc(tmp)
   
    If tmpAsc >= 48 And tmpAsc <= 57 Then
        tmp = tmp + 5
    Else
        tmp = tmp & "5"
    End If
   
    Text1 = CStr(tmp)
End Sub
0
marginalCommented:
In a new form put a array of Command1 buttons, then create Two TextBoxes (Text1 and Text2)
Text1 will recive alphabet letter and Text2 will recive the Index number

Code:

Private Sub Command1_Click(index as integer)
   
      'If you want to write A when you push Command1(1).
     
    If Index >= 1 And Index <= 28 Then
        Text1.Text= Char$(Index+47)
    Else
        Text2.Text = CStr(Index)
    End If
End Sub

I hope That help
                      MarginaL
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
grooneCommented:
Thats not what he was asking to do.  Sorry, but that isnt the right answer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.