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

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 12-21-2017, 05:49 AM   #46
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,214
Thanks: 90
Thanked 2,021 Times in 1,969 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

There is a lot of info re OOP and Access and Interface in this thread by jLeach

__________________

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.
jdraw is offline   Reply With Quote
The Following 2 Users Say Thank You to jdraw For This Useful Post:
jleach (12-21-2017), Uncle Gizmo (12-21-2017)
Old 12-28-2017, 10:08 PM   #47
Leo_Coroneos
Newly Registered User
 
Leo_Coroneos's Avatar
 
Join Date: Nov 2017
Location: Albany, Western Australia
Posts: 110
Thanks: 19
Thanked 1 Time in 1 Post
Leo_Coroneos is on a distinguished road
Re: Access OOP examples wanted

Quote:
Originally Posted by jdraw View Post
This is an outstanding link, a brilliant exposé of OOP and the principles behind it.

I don't know who posted the WithEvents link, but that one is even more awesome.

Geez, I feel like a kid in a candy store, only the candy is programming concepts, and my brain--which assimilates them--is equivalent to my greedy mouth licking and gnawing the candy.
__________________
Database Design Solutions
Databases for the 21st Century
Leo_Coroneos is offline   Reply With Quote
Old 07-25-2018, 07:07 PM   #48
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,214
Thanks: 90
Thanked 2,021 Times in 1,969 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

Just wanted to add a link to a class and related info from MarkK

__________________

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.
jdraw is offline   Reply With Quote
Old 02-10-2019, 08:27 AM   #49
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,214
Thanks: 90
Thanked 2,021 Times in 1,969 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

Here is a youtube video by PDTech describing his routine/class module to adjust and resize form controls.
His code is available as mentioned in the video.

I also want to highlight this link by Mile-O on a user authorisation/login class. I think this may have been the original question by spikepl that spawned this thread. Anyway, I am including the link since if provides the code and description.
__________________

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.
jdraw is offline   Reply With Quote
Old 02-10-2019, 09:40 AM   #50
MajP
Newly Registered User
 
Join Date: May 2018
Location: USA baby
Posts: 1,821
Thanks: 35
Thanked 553 Times in 524 Posts
MajP will become famous soon enough MajP will become famous soon enough
Re: Access OOP examples wanted

Here is one I did recently that demonstrates a lot of concepts. Capturing multiple events from multiple objects, raising cutom event, and trapping custom events. I replaced an Active X spinner control with a class.

https://www.access-programmers.co.uk...84&postcount=7

This has features that make it more flexible than a real spinner.
MajP is offline   Reply With Quote
Old 07-25-2019, 02:40 AM   #51
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 6,432
Thanks: 165
Thanked 1,736 Times in 1,706 Posts
Minty is a jewel in the rough Minty is a jewel in the rough Minty is a jewel in the rough
Re: Access OOP examples wanted

I'm at the start of learning a bit of C# online and totally coincidentally picked up on this article. https://medium.com/codeiq/object-ori...F-92a4b666c7c7

In the opinion of those far more knowledgeable than me is this actually pretty true ?
Personally I have always thought that whilst OOP looks like it could be nice, it seems to add complexity to simple tasks?
__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

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.
Minty is offline   Reply With Quote
Old 07-25-2019, 03:29 AM   #52
MajP
Newly Registered User
 
Join Date: May 2018
Location: USA baby
Posts: 1,821
Thanks: 35
Thanked 553 Times in 524 Posts
MajP will become famous soon enough MajP will become famous soon enough
Re: Access OOP examples wanted

Quote:
Personally I have always thought that whilst OOP looks like it could be nice, it seems to add complexity to simple tasks?
For me I would say the other way around. It makes a complex task simple.
I am not familiar with some of the very modern languages that are non OOP, so would have to learn about those, but there are things I have coded that I could not imagine how it could be done without OOP.

MajP is offline   Reply With Quote
The Following User Says Thank You to MajP For This Useful Post:
Minty (07-26-2019)
Old 07-25-2019, 04:51 AM   #53
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,507
Thanks: 92
Thanked 1,670 Times in 1,551 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Access OOP examples wanted

Like all endeavors, OOP is a "pay me now or pay me later" type of activity.

When done well, it makes use of that object class almost trivial. When done poorly, you find it harder because (perhaps) the class is missing some important methods or properties that have to be done outside of the class context. This is true in any language that supports the concept of OOP. It is still only as good as the programmer.

The decision to go "object oriented" leads to a project for which all of the normal rules and guidelines apply - lay it out beforehand, do a thorough analysis of required functionality and the data needed to support same, test it to a fare-thee-well. That's the same advice we give to so many here. The fact of it being OOP doesn't change the fact that it is a programming project of some complexity for which there is a cost and there is a benefit.

So does OOP add complexity to simple tasks? It could. Does OOP make complex tasks simpler? It could.

The fact remains that any truly compiled language can do anything that any other compiled language can do. But that doesn't mean every language presents the same difficulty in doing so. C variants and Pascal variants are pretty good about structuring. BASIC and FORTRAN, less so. Let's NOT bring up COBOL for OOP. Visual Basic is the attempt to overcome BASIC's primitive structuring capabilities. It becomes possible with VB and its VBA bastard child to have a language that supports methods and properties, but even something so clunky as P/L-1 allowed language extensions to support OOP.

As always, the focus should remain on the goals and the process by which you reach them. Pay now, pay later. We've all seen it.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
The Following User Says Thank You to The_Doc_Man For This Useful Post:
Minty (07-26-2019)
Old 07-25-2019, 10:52 AM   #54
NauticalGent
Pristine Curmudgeon
Gold Supporter
 
NauticalGent's Avatar
 
Join Date: Apr 2015
Location: Naples, Italy (EXPAT from Virginia)
Posts: 1,989
Thanks: 439
Thanked 295 Times in 256 Posts
NauticalGent has a spectacular aura about NauticalGent has a spectacular aura about
Re: Access OOP examples wanted

Quote:
Originally Posted by Minty View Post
I'm at the start of learning a bit of C# online and totally coincidentally picked up on this article. https://medium.com/codeiq/object-ori...F-92a4b666c7c7

In the opinion of those far more knowledgeable than me is this actually pretty true ?
Personally I have always thought that whilst OOP looks like it could be nice, it seems to add complexity to simple tasks?
Interesting that you of all people would post that Minty! Assuming that Class Modules ARE OOP, then the rest of my post is accurate, if not then it would not be the first time I ran my mouth needlessly...

It was YOU Minty that made me aware of what a Class Module can do:

https://www.access-programmers.co.uk...d.php?t=294107

FMS has a very robust error handling Class that is a bear to retro-fit but once you get all the bugs ironed out, there is no going back.

MarKK’s User Module (discusses earlier in this thread) comes in handy as well.

All that being said, not being a true programmer, I cannot argue for or against OOP. But the ability to do what little it does (that I’m aware of) makes it worthwhile for me.
__________________
- Ciao, John
NauticalGent is offline   Reply With Quote
The Following User Says Thank You to NauticalGent For This Useful Post:
Minty (07-26-2019)
Old 10-06-2019, 06:30 AM   #55
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,214
Thanks: 90
Thanked 2,021 Times in 1,969 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

Here is another link I stumbled upon when looking for a MouseOver Event. Yes, I know there is no intrinsic MouseOver event in Access, but found this and thought someone may find it useful.
__________________

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.
jdraw is offline   Reply With Quote
Old 10-09-2019, 12:37 PM   #56
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,238
Thanks: 15
Thanked 1,591 Times in 1,511 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Access OOP examples wanted

The very worst Access app I ever had to modify was created by an "expert" developer who decided that he needed to apply OOP to Access. EVERYTHING was seven or more levels deep and at the end was rarely more than a couple of lines of code and many were just one line. It was a nightmare to try to follow the logic and eventually modify it. The first change was small and I managed to do it but I told the client - never again. If you want something done with that app, I'm going to have to rewrite it. I probably spent 10 hours doing something that even in an application that I had never laid eyes on before should have been less than an hour.

I'm glad to see that others have come around to my opinion.

Coupling and Cohesion were big words back in the 80's and they have stood the test of time. Applications/programs/procedures should be highly cohesive and loosely coupled. What that means is your payroll application should not be scheduling the shop floor just because they share a calendar table. And nothing should require large numbers of arguments to operate.

I once came across an error procedure that was hundreds of lines of code. Why? because the person who wrote it created error messages and assigned them numbers and then in the "common" procedure used a case statement to pick each error by number and do something different and display a unique message. What was saved by this? Nothing. It just abstracted the problem one level and made it harder to understand. Creating a table of error messages makes some sense because it makes things easier to find and messages easier to change if necessary but if you're going to do something custom for each error, do it where the error occurred, not in a "common" procedure.

Routines that are shared should do the same thing regardless of what initiates them. If they do something different when called from a than they do when called from b, then there is nothing common about the code and it would be easier to have two separate procedures. The called code should NEVER have to know what procedure called it to determine what to do.
__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Old 10-09-2019, 07:24 PM   #57
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,507
Thanks: 92
Thanked 1,670 Times in 1,551 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Access OOP examples wanted

Pat brings up an excellent point that shows a major weakness of OOP. If you don't implement your object class very well, debugging becomes a multi-layered nightmare. A 7-layer Taco Salad can be a treat. A 7-layer object-oriented debug session can become a context nightmare. In terms of program logic flow or program data flow, diagramming such a beast can be horrific.

I would never go so far as to say that OOP is a bad idea. But there are problems where OOP is serious overkill vis-a-vis desired result vs. required effort. Therefore, when Minty says:

Quote:
Personally I have always thought that whilst OOP looks like it could be nice, it seems to add complexity to simple tasks?
I have to agree with him. There is a level of effort that is appropriate to certain tasks for which OOP is too much work for too little return. And equally, there are certain projects where OOP is almost mandatory if you want to stay sane (and stay consistent) in what you do.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 10-10-2019, 01:16 AM   #58
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,326
Thanks: 40
Thanked 3,666 Times in 3,535 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: Access OOP examples wanted

I use OOP for some things, but not all. Primarily for creating new events

Took a look at JDraws mouseover event link as I have written my own class to handle it. The code in the link is simpler than mine, but suffers from the same problem of the basic mousemove event of the mouse moving too quickly so the move event is not detected in surrounding section/controls - and may even no longer be over the form/access.

Mine uses a class timer event and behaves much like the button hover event or the event which displays the controltiptext
  • On first detecting a mouse move event, code is run (e.g. to change the back color) and the class timer interval set - perhaps 10th of a second
  • subsequent mouse move events do not rerun the code but does reset the interval
  • when the timer event is triggered, it compares the mouse position with the control location - if still over the control (user might have stopped moving the mouse), it resets the interval otherwise it carries out the the required 'not over' event such as change the back color back again.
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 11-07-2019, 08:08 AM   #59
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,214
Thanks: 90
Thanked 2,021 Times in 1,969 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

CJ, perhaps you could post your class with a sample.


Here are a couple of youtube videos by Paul Kelly re Class Modules. He uses Excel (that's the basis of his business) but the concepts and examples apply to Access.

-Class Modules Explained in Simple English
-Class Modules with Collections

He has a lot of data structure materials at his website
-here's a class module tutorial

__________________

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.

Last edited by jdraw; 11-07-2019 at 08:20 AM.
jdraw is offline   Reply With Quote
The Following User Says Thank You to jdraw For This Useful Post:
Uncle Gizmo (11-07-2019)
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
Access Guru Wanted safgan General 1 08-22-2005 05:40 PM
[SOLVED] 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 10:35 PM.


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