'clsTextboxGroup
'-------------------------------------------------------------------
Option Compare Database
Option Explicit
Public WithEvents TextBoxGroup As Access.TextBox
Private Sub TextboxGroup_DblClick(Cancel As Integer)
MsgBox "Hello from " & TextBoxGroup.Name
'I will put in more substantive events after I get this working
End Sub
'-------------------------------------------------
'the form's module
Option Compare Database
Option Explicit
Dim MyTextboxes() As New clsTextBoxGroup
Private Sub Form_Load()
Call InitMyTextboxEvents
end sub
'---------------------------------------------------
Public Sub InitMyTextboxEvents()
Dim TextboxCount As Integer
Dim ctl As Control
' Create the Textbox Objects
TextboxCount = 0
For Each ctl In Forms("frmWeek").Detail.Controls
If ctl.ControlType = acTextBox Then
If ctl.Name Like "*booking*" Then 'snag only the required textbox controls
TextboxCount = TextboxCount + 1
ReDim Preserve MyTextboxes(1 To TextboxCount)
Set MyTextboxes(TextboxCount).TextBoxGroup = ctl
End If
End If
Next ctl
end sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE