Go Back   Access World Forums > Microsoft Access Discussion > Theory and practice of database design

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 04-07-2017, 08:26 AM   #31
Frothingslosh
Premier Pale Stale Ale
 
Frothingslosh's Avatar
 
Join Date: Oct 2012
Location: Flint, Michigan, USA
Posts: 3,211
Thanks: 83
Thanked 456 Times in 413 Posts
Frothingslosh will become famous soon enough Frothingslosh will become famous soon enough
Re: Access OOP examples wanted

And honestly, classes stopped being intimidating once I just bit the bullet and wrote a couple. Beginners should just get a quick reference (I think Chip Pearson had a good one) showing how to set up properties and the Initialize and Terminate procedures, and then just write a couple and work with them.

I have simple examples in my Polymorphism example above, and my progress meters post over in the Repository is completely class-based.

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Frothingslosh is offline   Reply With Quote
Old 04-29-2017, 05:53 PM   #32
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,142
Thanks: 81
Thanked 2,010 Times in 1,958 Posts
jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light
Re: Access OOP examples wanted

Update: Uncle Gizmo AKA Tony Hine has posted some youtube videos dealing with OOP and MsAccess.

Thanks Tony.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jdraw is online now   Reply With Quote
The Following User Says Thank You to jdraw For This Useful Post:
Uncle Gizmo (09-27-2017)
Old 04-30-2017, 12:59 AM   #33
NauticalGent
Pristine Curmudgeon
Gold Supporter
 
NauticalGent's Avatar
 
Join Date: Apr 2015
Location: Naples, Italy (EXPAT from Virginia)
Posts: 1,938
Thanks: 433
Thanked 284 Times in 249 Posts
NauticalGent has a spectacular aura about NauticalGent has a spectacular aura about
Re: Access OOP examples wanted

Quote:
Originally Posted by jdraw View Post
Update: Uncle Gizmo AKA Tony Hine has posted some youtube videos dealing with OOP and MsAccess.

Thanks Tony.
I have been watching about as fast as he can post. I really get a kick out of watching the debug process!

AND...I picked up a neat little trick on how to comment out a whole block of code in instead of "tip-toeing through the tulips"!

NauticalGent is offline   Reply With Quote
Old 04-30-2017, 07:20 AM   #34
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,095
Thanks: 421
Thanked 753 Times in 731 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: Access OOP examples wanted

Quote:
Originally Posted by NauticalGent View Post
AND...I picked up a neat little trick on how to comment out a whole block of code in instead of "tip-toeing through the tulips"!
I'f love to know about that, as I frequently comment out code when trying new things.
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 04-30-2017, 07:30 AM   #35
NauticalGent
Pristine Curmudgeon
Gold Supporter
 
NauticalGent's Avatar
 
Join Date: Apr 2015
Location: Naples, Italy (EXPAT from Virginia)
Posts: 1,938
Thanks: 433
Thanked 284 Times in 249 Posts
NauticalGent has a spectacular aura about NauticalGent has a spectacular aura about
Re: Access OOP examples wanted

Sho' nuff...

I watched Tony do it and was wondering how he did so I consulted Dr. Google and here is what he had to say:

http://stackoverflow.com/questions/1...ice-vba-editor
NauticalGent is offline   Reply With Quote
Old 04-30-2017, 08:32 AM   #36
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,095
Thanks: 421
Thanked 753 Times in 731 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: Access OOP examples wanted

Wow, that is so handy, and it has been there all the time?

Thanks for that.
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 04-30-2017, 11:02 AM   #37
Frothingslosh
Premier Pale Stale Ale
 
Frothingslosh's Avatar
 
Join Date: Oct 2012
Location: Flint, Michigan, USA
Posts: 3,211
Thanks: 83
Thanked 456 Times in 413 Posts
Frothingslosh will become famous soon enough Frothingslosh will become famous soon enough
Re: Access OOP examples wanted

Quote:
Originally Posted by Gasman View Post
Wow, that is so handy, and it has been there all the time?
Yep. I always assumed everyone already knew about it.

Just as an FYI, if you use SQL Server Management Studio, it has the same buttons available there, too.

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Frothingslosh is offline   Reply With Quote
The Following User Says Thank You to Frothingslosh For This Useful Post:
NauticalGent (04-30-2017)
Old 06-13-2017, 09:03 AM   #38
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,276
Thanks: 528
Thanked 927 Times in 879 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Access OOP examples wanted

I thought this may be of interest:-

Creating and Using Collections in VBA
http://www.wiseowl.co.uk/blog/s239/collections.htm
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 06-13-2017, 09:38 AM   #39
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,142
Thanks: 81
Thanked 2,010 Times in 1,958 Posts
jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light
Re: Access OOP examples wanted

Tony,

It's funny you mention the wiseowl tutorial. I've seen many of these on classes and web scraping and find them excellent --although geared to Excel, but all done using vba. And easily portable to Access. There are several videos, all available free from wiseowl site. (see post #20 in this thread)

There are also some great youtube videos by Paul Kelly (Excel Macro Mastery) --collections etc.
He offers free webinars a couple of times a week (latest is http://excelmacromastery.us10.list-m...4&e=d2b706b539 ). He is selling ( at a discount to webinar viewers) an Excel application product (http://excelmacromastery.us10.list-m...f&e=d2b706b539) for those interested. It is a handbook with 10 full blown vba applications. I'm not an excel person, but find his presentations quite well done and informative.

jack
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by jdraw; 06-13-2017 at 10:16 AM.
jdraw is online now   Reply With Quote
The Following User Says Thank You to jdraw For This Useful Post:
Uncle Gizmo (07-08-2017)
Old 07-08-2017, 03:11 PM   #40
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,276
Thanks: 528
Thanked 927 Times in 879 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Access OOP examples wanted

YouTube must be monitoring my activity as it served up this excellent video on why object Orient oriented programming is bad...


Object-Oriented Programming is Bad
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
The Following User Says Thank You to Uncle Gizmo For This Useful Post:
coypu (03-16-2019)
Old 07-08-2017, 09:33 PM   #41
NauticalGent
Pristine Curmudgeon
Gold Supporter
 
NauticalGent's Avatar
 
Join Date: Apr 2015
Location: Naples, Italy (EXPAT from Virginia)
Posts: 1,938
Thanks: 433
Thanked 284 Times in 249 Posts
NauticalGent has a spectacular aura about NauticalGent has a spectacular aura about
Re: Access OOP examples wanted

Quote:
Originally Posted by Uncle Gizmo View Post
Interesting take on OOP. I have lived some of his views while trying to tame the monster I inherited. I found myself rocking back and forth on simple issues as far as where to put the code (should I make a separate Module, should I put it in the Objects Class, do I make a "Utilities" Module, etc) instead of simply "just doing it". His metaphor about individually wrapped candies was spot-on!

All that being said, the true nature of this video really doesn't apply to most of us on this forum. A huge percentage of our coding is done within forms and reports which forces us to comply with OOP to some extent.

To a non-programmer such as myself, Access's code-behind-the-forms paradigm was a God-send. All of a sudden I could do cool things without having to take a butt-ton of CS courses and invest in pocket protectors.

Funny thing is, my first introduction to databases was with Paradox/PAL, which at the time was a break from traditional programming (or so I was told) but to really do anything spectacular with it, you had to write whole procedures.

When Windows 95 became the norm and subsequently MS Office, I rebeled against the machine and went an RDBMS strike until I was forced back into it in 2008. By then Paradox and all other RDBMS apps were marginalized and Access stood alone at the top.

I held my nose and started to learn it and after awhile I decided it didn't really smell all that bad and when Access became the reason for my employment a year ago, it smells 'purt damn nice.

Anyway, now that I have made this all about me, thanks for the video. It is refreshing to see different POV's on things.

Edit: On reflection, unless I missed something, the speaker never really spoke to the actual performance of OOP in relation to the other methods. Only the readability and other aesthetics. Hardly a solid platform to sell your case on...

Last edited by NauticalGent; 07-09-2017 at 12:13 AM.
NauticalGent is offline   Reply With Quote
The Following 2 Users Say Thank You to NauticalGent For This Useful Post:
Leo_Coroneos (12-28-2017), Uncle Gizmo (07-12-2017)
Old 07-12-2017, 10:04 PM   #42
DBQueen
Newly Registered User
 
Join Date: Jul 2017
Posts: 6
Thanks: 12
Thanked 1 Time in 1 Post
DBQueen is on a distinguished road
Re: Access OOP examples wanted

I would like to know more of OOP. I was used to procedural programming during my younger years .

I have seen some of Uncle Gizmo's video and they're very good.
DBQueen is offline   Reply With Quote
Old 11-03-2017, 08:23 AM   #43
MarkK
Super Moderator
 
MarkK's Avatar
 
Join Date: Mar 2004
Location: Vancouver BC
Posts: 7,761
Thanks: 10
Thanked 1,289 Times in 1,227 Posts
MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all
a sample User class

As per a conversation with John (Nautical Gent) in a thread about global variables, here is a basic User class that you might implement or customize or whatever. Your data access doesn't have to be as complicated as that cDataRecord class I use in there, but that's just my stock data access class so I'll leave it in. Note that this is just the User and doesn't have a related table/class for logins and logouts, which would make a ton of sense to add, but maybe this gives some idea of how to get started.

To make this work, double click the fUser form. Your Windows username will not likely be present in the table, so a Wizard will pop up right away to help you add yourself.

After that, opening the fUser form will automatically recognize your Windows login, and load your record from the table into a new instance of the class. You can also spoof other users by making a selection in the combo.

Makes sense?
Mark
Attached Files
File Type: zip cUserSample.zip (72.8 KB, 70 views)
__________________
formerly known as lagbolt | Windows 10 | Access 2010 | Visual Studio 2013 | "Institutions have a vested interest in perpetuating the problems to which they are the solution." - Clay Shirky
MarkK is offline   Reply With Quote
The Following User Says Thank You to MarkK For This Useful Post:
NauticalGent (11-03-2017)
Old 11-25-2017, 07:17 AM   #44
NauticalGent
Pristine Curmudgeon
Gold Supporter
 
NauticalGent's Avatar
 
Join Date: Apr 2015
Location: Naples, Italy (EXPAT from Virginia)
Posts: 1,938
Thanks: 433
Thanked 284 Times in 249 Posts
NauticalGent has a spectacular aura about NauticalGent has a spectacular aura about
Re: Access OOP examples wanted

MarkK, thanks for the example. I fiddled with it to suit my needs and although some might argue that I am using a bazooka to kill a mosquito, there are some distinct advantages that I think are available to me now.

I was using Public Type Variables to hold user info - I thought they were neat because they were always at the ready but I didn’t like having system resources been used on holding it in memory. Probably over reacting but I am a product of the DOS/64k generation.

Also, although I have not been able to duplicate the event, I have experienced where my application “forgot” the user info after the user had logged in.

What I like about your Class Module is how I can recall what I need on demand regardless of what hiccups may occur during a session, not to mention future expansion if I need to add user validation-based input and how to handle those situations.

Thanks again for posting...
__________________
- Ciao, John
NauticalGent is offline   Reply With Quote
Old 11-25-2017, 02:26 PM   #45
MarkK
Super Moderator
 
MarkK's Avatar
 
Join Date: Mar 2004
Location: Vancouver BC
Posts: 7,761
Thanks: 10
Thanked 1,289 Times in 1,227 Posts
MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all
You bet John. Another thing I like about using classes is that the class becomes the central location for any and all business logic related to that type of object.

As a beginner I remember maybe I would write some functionality I needed into a form, but then later on perhaps I would need to duplicate that functionality in a report. So I could copy the code, or open a hidden instance of the form, but if you write a class and put all that class's related functionality in the class module, then it becomes a really useful organizing principle in how to write overall systems. You can instantiate that class in whatever context you need it--form or report or other class--and it exposes it's members via intellisense. Then when you come back to your code six months later, adding features--and not duplicating existing ones--is considerably simplified.

Cheers,

__________________
formerly known as lagbolt | Windows 10 | Access 2010 | Visual Studio 2013 | "Institutions have a vested interest in perpetuating the problems to which they are the solution." - Clay Shirky
MarkK is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2003 resource database help wanted. Doogle General 0 06-18-2009 06:29 AM
Access Query not displaying everything I wanted dubsdj Queries 3 03-25-2009 05:14 AM
[SOLVED] Access Guru Wanted safgan General 1 08-22-2005 05:40 PM
Need Access Help. onsultant Wanted Tonight. robjordan General 1 10-07-2004 09:12 PM
Access Database Examples Trinb37 General 1 03-05-2004 11:13 AM




All times are GMT -8. The time now is 05:02 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World