jwcolby54
Active member
- Local time
- Yesterday, 19:33
- Joined
- May 19, 2025
- Messages
- 283
I have a new blog up about clsMsgPD which is a predefined or predeclared class which I use to pass messages around. In this case a client asked me to create a "big edit" form. The user could dbl-click into any text box following a naming convention and doing so would open a form with a single large text box which would contain the text back in the text control dbl-clicked in. They could edit the text and when they closed the form the edited data would appear back in the text control that was dbl-clicked in.
This demonstrates several powerful abilities of VBA.
The forms and classes can be found in the demo database.
EventDrivenProgrammingInVBA.pdf
EventDrivenProgrammingDemoDB.accdb
Any questions about how it works will be fielded right here.
Thanks!
This demonstrates several powerful abilities of VBA.
- Predeclared classes - clsMsgPD
Predeclared classes - default instance
- Raising events - clsMsgPD.Send(varFrom As Variant, varTo As Variant, varSubj As Variant, varMsg As Variant)
RaiseEvent Message(varFrom, varTo, varSubj, varMsg)
- Passing a control into a variant - clsCtlTxt.mctlTxt_DblClick ...
clsMsgPD.Send "", "frmLongDataEntry", "", mctlTxt
- Coercing a variant into a text box - frmLongDataEntry.mclsMsgPD_Message event sink
Set mtxtPassedIn = varMsg
The forms and classes can be found in the demo database.
EventDrivenProgrammingInVBA.pdf
EventDrivenProgrammingDemoDB.accdb
Any questions about how it works will be fielded right here.
Thanks!
Last edited: