Search results

  1. jwcolby54

    The message class - RAISING events

    The keywords Public and Private are called scope. Public means that it can be seen by entities outside of the class, Private means that it cannot be seen outside of the class. Public is the default, IOW if you don't specifically say private, then it is public. At least that is true for...
  2. jwcolby54

    The message class - RAISING events

    The real point is that by creating something like clsMsgPD and clsCtlTxt, I can now have this functionality in any form I want in my app. I can have it in several forms. Or every form. All I have to do is name my txtbox to start with txtDE and it "inherits" the behavior to open...
  3. jwcolby54

    The message class - RAISING events

    Study clsMsgPD, frmTestEditField and frmLongDataEntry to watch it all happen. Oh yea, and clsCtlText. TheDblClick event in there launches frmLongDataEntry. Place a breakpoint in there and step through the code to really understand this. It isn't hard, but watching the events is critical to...
  4. jwcolby54

    The message class - RAISING events

    And finally, when the form closes, we need to copy the edited data back into the control passed in. And cleanup behind ourself. Private Sub Form_Close() ' 'When the form closes, place the edited text from txtDataEntry 'back into the text box that was passed in. '...
  5. jwcolby54

    The message class - RAISING events

    Nothing magic here. Private WithEvents mclsMsgPD As clsMsgPD is a pointer to a message class - dimmed Withevents - which simply means that it can SINK the events from clsMsgPD. The following code sinks the mclsMsgPD_Message event raised by the clsMsgPD It checks the varTo parameter to make...
  6. jwcolby54

    The message class - RAISING events

    The code behind form for frmLongDataEntry is as follows: Private WithEvents mclsMsgPD As clsMsgPD Private mtxtPassedIn As TextBox Private mtxtDataEntry As TextBox Private Sub Form_Open(Cancel As Integer) Set mtxtPassedIn = txtPassedIn Set mtxtDataEntry = txtDataEntry ' 'Clear...
  7. jwcolby54

    The message class - RAISING events

    I did this of course with Events. frmTestEditField contains the following in the code behind form: Option Compare Database Option Explicit Private mclsFrm As clsFrm Private Sub Form_Open(Cancel As Integer) ' Set mclsFrm = New clsFrm mclsFrm.fInit Me End Sub ' 'Clean up behind ourself...
  8. jwcolby54

    The message class - RAISING events

    Now edit the text in the text box with the label Enter Data Below. You can edit in any way you see fit. The field behind the first form uses long text data types which means that you can put very long stuff in there if you desire. When you close the form, whatever you edited in this form will...
  9. jwcolby54

    The message class - RAISING events

    Now dblClick in Edit Fld 1. You should see this:
  10. jwcolby54

    The message class - RAISING events

    The demo for Long Data Entry is working in EventDrivenProgrammingDemoDB. My blog is in my signature. Download both the EventDrivenProgrammingDemoDB.ACCDB as well as the EventDrivenProgrammingInVBA.PDF. Place the demodb in a directory specially built for EventDrivenProgrammingInVBA. <Grin> Or...
  11. jwcolby54

    Wrapping controls WithEvents in classes

    LOL, going back and reading my own blog posts from 2013 is interesting. I was 12 years closer to my old work back then...:geek:
  12. jwcolby54

    Wrapping controls WithEvents in classes

    Or maybe PowerApps is his missing piece?
  13. jwcolby54

    Wrapping controls WithEvents in classes

    Are you related to Elon by any chance?:ROFLMAO:
  14. jwcolby54

    Wrapping controls WithEvents in classes

    It strikes me as signing up to rewrite the demo database included in Access. That had to be even worse. And sometimes it is not ready to be seen?
  15. jwcolby54

    Wrapping controls WithEvents in classes

    I just spent all morning out in the demo database itself fixing naming convention errors, and adding a pCtlName property in every control wrapper class. I pushed those back into the book, though only 4 of the dozens of controls / control classes from the demo database have made it into the...
  16. jwcolby54

    Wrapping controls WithEvents in classes

    Yes, and @Gasman has been a real trooper struggling to keep me in line.
  17. jwcolby54

    Wrapping controls WithEvents in classes

    @Gasman I just realized what one of your frustrations is, when I change the book you have to change your database you have been writing. I am trying to clean up the Demodb to make it consistent in naming. In half the places I was just doing something like dim mTxt as text box. In other...
  18. jwcolby54

    Wrapping controls WithEvents in classes

    @Gasman. My apologies but I just remembered that I need a name property for the classes. I am going back in and retrofitting the classes already written and "published". Access uses .Name for their objects. Sadly I have to deal with my class itself, and Me.name isn't a thing. Me being MY...
  19. jwcolby54

    Wrapping controls WithEvents in classes

    The event driven way I used is to set up a message class, clsMsgPD. See my blog for that. Or the demo database. In the dblClick in frmTestEditField some text box (named correctly) ... txtDE then XXXXX for the rest of the text box name. I open frmLngDataEntry, then call a function in...
  20. jwcolby54

    Wrapping controls WithEvents in classes

    BTW this form also demonstrates one (Event Driven) way to do updates to any field where the form needs a bunch of small text boxes but the field being edited may have more data than can be easily edited in a small text box. If you dbl-click in any of the edit fld 1,2 or 3, a new form will open...
Back
Top Bottom