Nothing you mentioned suggests any need or utility for building a custom class. You describe standard database record manipulation (add, edit, delete). DAO and ADODB are EXTREMELY robust classes to support data base structures and if it can be done in DAO or ADODB then unlikely you need a custom class. Everything you mentioned sounded like pure simple database record creation, manipulation, and edit.So...thoughts on a Part/Item class?
Maybe an example would help. Assume you have something that cannot be easily modeled by a single variable. In one I did recently the poster wanted to find the distance between two lat/longs stored in a database and do other latt long manipulation. So I had a couple functions that excepted a lat long and returned a value or returned a lat long.what is the benefit of declaring and using a type?
Public Type LatLong
DegreeLat as integer
MinutesLat as integer
DecimalSecondsLat as Single
NorS as String
DegreeLong as integer
MinutesLong as Integer
DecimalSecondsLong as Single
EorW as string
end type
Noting you have said indicates that a custom class would even be useful, let alone required. If you care to share with us what business problem you are trying to solve and what limitations standard methods have, we'll be happy to give you real advice. But YOU are the one who brought up custom classes.If someone suggests a class is better for situation X
Given @MajP type data structure above, the benefit of the structure is that you declare a variable of type latlong.Maybe an example would help. Assume you have something that cannot be easily modeled by a single variable. In one I did recently the poster wanted to find the distance between two lat/longs stored in a database and do other latt long manipulation. So I had a couple functions that excepted a lat long and returned a value or returned a lat long.
You could do this with a string representation, but you cannot manipulate a string easily so you have to parse it back into numbers.
(I actually did it with +/- decimal lattitudes and decimal longitudes, but for illustration assume this is my type)
"41°24'12.2"N 2°10'26.5"E"
Code:Public Type LatLong DegreeLat as integer MinutesLat as integer DecimalSecondsLat as Single NorS as String DegreeLong as integer MinutesLong as Integer DecimalSecondsLong as Single EorW as string end type
Now I can create a bunch of LatLongs and pass to different functions and easily manipulate them, but more importantly a function can return to me a LatLong with lots of pieces of information. It could be done with strings which would be a pain. Or it could be done with a function with 8 different arguments for the 8 properties of the latlong, bigger pain.