Hey OBP,
I've effectively adapted the code from https://sitestory.dk/excel_vba/calendar.htm
I've got:
Form: 'WFO'
Form: 'WorkForce'
Module: 'PublicVariables'
Class Module: 'clLabelClass'
WFO is the working form, WorkForce is the Main form that WFO is then placed in as a Sub Form
In the PublicVariables Module:
Public colLabelEvent As Collection
Public colLabels As Collection
In the WFO Form, I can't recall exactly where it's at, Open, or Load.. I'm not at work right now.
Dim ctl As Control
Dim InputLblEvt As clLabelClass
Set colLabelEvent = New Collection
Set colLabels = New Collection
For Each ctl In Form_WFO.Controls
If TypeOf ctl Is Access.ComboBox Then
Set InputLblEvt = New clLabelClass
Set InputLblEvt.InputLabel = ctl
colLabelEvent.Add InputLblEvt
colLabels.Add ctl, ctl.Name
End If
Next
in the Class Module:
Public WithEvents InputLabel As Access.Combobx
Private Sub InputLabel_AfterUpdate()
With InputLabel
msgbox ("It Worked")
End With
End Sub
Reason is similar to the calendar, there's just alot, and also, I'm learning as I'm going, so, I'd like to know for future projects.
Hope this helps clarify,
Thanks.