Home All Groups Group Topic Archive Search About

One procedure for a textbox array?

Author
26 May 2005 11:21 PM
Thief_
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.



--
Show quoteHide quote
|
+-- Thief_
|

Author
26 May 2005 11:26 PM
Veign
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/


Show quoteHide quote
"Thief_" <thi***@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_
> |
>
>
Author
27 May 2005 12:45 AM
Thief_
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!

--
Show quoteHide quote
|
+-- 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_" <thi***@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_
> > |
> >
> >
>
>
Author
27 May 2005 12:55 AM
Veign
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/


Show quoteHide quote
"Thief_" <thi***@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...
> > 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_" <thi***@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_
> > > |
> > >
> > >
> >
> >
>
>
Author
27 May 2005 12:49 AM
Gary Nelson
"Thief_" <thi***@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
Author
27 May 2005 3:52 AM
Thief_
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!

--
Show quoteHide quote
|
+-- Thief_
|

"Gary Nelson" <gn@nospam.com> wrote in message
news:%23BU%23%23XlYFHA.2996@TK2MSFTNGP10.phx.gbl...
>
> "Thief_" <thi***@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
>
>