View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dan Gardner Dan Gardner is offline
external usenet poster
 
Posts: 11
Default Useing Class structures and Events

I have created a class of textbox objects on a form with the following code;
Dim Listings() As New Class1
Dim listcount As Integer
Dim ctl As Control
listcount = 0

For Each ctl In Tag_Priority.Controls
If TypeName(ctl) = "TextBox" And ctl.Visible = True Then
listcount = listcount + 1
ReDim Preserve Listings(1 To listcount)
Set Listings(listcount).listgroup = ctl
End If
Next ctl

Class Module -
Public WithEvents listgroup As MSForms.TextBox
Private Sub listgroup_Change()

Bla Bla Bla

End sub

The problem is that the Change() event triggers each time a single digit is
modified in the included textboxs. It works great for my Bla Bla Bla code
when my textbox.text inputs are single digits 1,2,3, etc. but is a disaster
when I want to enter double digit numbers like 11,12,13, etc., each number is
its own textbox. I was hoping there is an event trigger or something I could
use that would trigger when I select another object either in that class or
on that form.

The form presents a list with associated priorities as texboxes, the idea is
that the user can change the textbox value which will then reprioritize the
list based on the new individual textbox inputs.

Im using Office 2000, I would apriciate any help that could be offered, Im
twisting my brain up in knots with logic statements. Thanks,