For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > May 2005 > One procedure for a textbox array?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author One procedure for a textbox array?
Thief_

2005-05-27, 3:55 am

I need to create one procedure to control the data input into an array of
textboxes. I need it to work with an ARRAY of textboxes. Is there any way of
doing this?

Note that the textboxes are ALREADY on the userform so I can't use dynamic
addition of controls here.



--
|
+-- Thief_
|


Veign

2005-05-27, 3:55 am

You say UserForm so is this from a VBA application?

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/


"Thief_" <thief_@hotmail.com> wrote in message
news:ezNCgmkYFHA.616@TK2MSFTNGP12.phx.gbl...
> I need to create one procedure to control the data input into an array of
> textboxes. I need it to work with an ARRAY of textboxes. Is there any way

of
> doing this?
>
> Note that the textboxes are ALREADY on the userform so I can't use dynamic
> addition of controls here.
>
>
>
> --
> |
> +-- Thief_
> |
>
>



Thief_

2005-05-27, 3:55 am

Sorry Veign,

I'm a VBA & VB programmer and hate having to call the same object different
names depending on which development environment I'm using! It's a VB6 app
and I just got a brain-freeze, but I got the solution anyway after sitting
back and having a coffee!

--
|
+-- Thief_
|

"Veign" <NOSPAMinveign@veign.com> wrote in message
news:ukzHwrkYFHA.584@TK2MSFTNGP15.phx.gbl...
> You say UserForm so is this from a VBA application?
>
> --
> Chris Hanscom - Microsoft MVP (VB)
> Veign's Resource Center
> http://www.veign.com/vrc_main.asp
> --
> Read. Decide. Sign the petition to Microsoft.
> http://classicvb.org/petition/
>
>
> "Thief_" <thief_@hotmail.com> wrote in message
> news:ezNCgmkYFHA.616@TK2MSFTNGP12.phx.gbl...
of[color=darkred]
way[color=darkred]
> of
dynamic[color=darkred]
>
>



Gary Nelson

2005-05-27, 3:55 am


"Thief_" <thief_@hotmail.com> wrote in message
news:ezNCgmkYFHA.616@TK2MSFTNGP12.phx.gbl...
>I need to create one procedure to control the data input into an array of
> textboxes. I need it to work with an ARRAY of textboxes. Is there any way
> of
> doing this?
>
> Note that the textboxes are ALREADY on the userform so I can't use dynamic
> addition of controls here.
>

If you have an array of textboxes they automatically use the same procedure.

For example, if you want to control what key is pressed use the following
sub:

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)

End Sub

Gary


Veign

2005-05-27, 3:55 am

No problem - Glad you got it working.

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/


"Thief_" <thief_@hotmail.com> wrote in message
news:uZ1aVVlYFHA.3356@TK2MSFTNGP15.phx.gbl...
> Sorry Veign,
>
> I'm a VBA & VB programmer and hate having to call the same object

different
> names depending on which development environment I'm using! It's a VB6 app
> and I just got a brain-freeze, but I got the solution anyway after sitting
> back and having a coffee!
>
> --
> |
> +-- Thief_
> |
>
> "Veign" <NOSPAMinveign@veign.com> wrote in message
> news:ukzHwrkYFHA.584@TK2MSFTNGP15.phx.gbl...
> of
> way
> dynamic
>
>



Thief_

2005-05-27, 3:55 am

Thanks guys,

I needed one procedure to handle the events of both single-textboxes and
array-textboxes. My solution was to create a usercontrol textbox with the
validation code in the usercontrol. I could then place single-instances or
array-instances of the control on the (user)form!

--
|
+-- Thief_
|

"Gary Nelson" <gn@nospam.com> wrote in message
news:%23BU%23%23XlYFHA.2996@TK2MSFTNGP10.phx.gbl...
>
> "Thief_" <thief_@hotmail.com> wrote in message
> news:ezNCgmkYFHA.616@TK2MSFTNGP12.phx.gbl...
way[color=darkred]
dynamic[color=darkred]
> If you have an array of textboxes they automatically use the same

procedure.
>
> For example, if you want to control what key is pressed use the following
> sub:
>
> Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
>
> End Sub
>
> Gary
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com