I am happy to add my 2 bounces - although i have no idea about classes and often fail to make my userform run
Well done a problem solved is a problem no more
I am happy to add my 2 bounces - although i have no idea about classes and often fail to make my userform run
Well done a problem solved is a problem no more
Cheers for your help
dj
'Extreme VBA Newbie in progress - one step at a time - like a tortoise's pace'
Attached is the working demo for anyone who may be interested.
Glad you solved it
Thanks for the upload of the finished product
Q: So if I want to use it, I'd
a. Create the UF with controls, etc.
b. Insert your clsFormControlEvents into the project
c. Write or customize 3 userform subs and function
Sub InitializeValidationAndPrompts(),
Public Sub Change_ValidateControl_Form(oCtrl As Object)
Private Function fcnValidate(oCtrl As Object) As Boolean
Thereafter, your 'classy' class does all the heavy lifting
---------------------------------------------------------------------------------------------------------------------
Paul
Remember: Tell us WHAT you want to do, not HOW you think you want to do it
1. Use [CODE] ....[/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ, especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq...._new_faq_item3
Paul (and SamT too)
Thank you! Your methods give me something to think about. As for your Q above, yes. That about sums it up. Of course the class at this stage was built to handle the demo. The demo events "Cick" and "Change" "SpinUp/Down" are about the only one I ever use but I can add more (and so can you).
The prompt piece is builds upon previous work shared with me by Christopher Mackay a few months ago.
I had come across the CallByName function before when reading through VBA help but the example MS has published doesn't work as written and after fixing it I wandered about the point as the same thing can be done much easier (or seemed to me) without using it.
SamT's suggestions about setting the form as an object (which I think I had already done in a round about way) stirred a dim recollection of CallByName and the rest is history.
I've attached a document showing the basic MS example and why I thought it was pointless and showing how the Application.Run falls over and can be overcome.
I was working on something a couple of months ago where I had to set up two way communication between 2 or more User Defined Objects. I figgered it should work with a UserForm Object.
Unfortunately, I didn't know about CallByName then.
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ