I have often thought that some developers turn to Classes too quickley when a simple UDT is all that was needed. Using a sledge hammer to drive a finishing nail if you will. Thanks Philipp!
I've only ever used this to proceed in a more structured way, but it makes even more sense for parameter transfer. Super, got a great suggestion, thanks!
Thank you, John! The T-shirt was a gift from Microsoft at the Access DevCon 2019 conference in Vienna, Austria. BTW: Registration for Access DevCon 2022 just opened last week. Take a look at the agenda if you like: www.donkarl.com/devcon/agenda.htm Due to Covid, it has to be a virtual conference this year.
Does the ThePerson UDT argument must be passed ByRef to the callee procedure as shown in your code ? if not, does it make any difference to pass the UDT argument ByVal vs ByRef ?
ByVal vs ByRef is always the same. ByVal will copy the value passed into the parameter. ByRef passes the memory reference to the parameter of the function.
I have often thought that some developers turn to Classes too quickley when a simple UDT is all that was needed. Using a sledge hammer to drive a finishing nail if you will. Thanks Philipp!
I've only ever used this to proceed in a more structured way, but it makes even more sense for parameter transfer. Super, got a great suggestion, thanks!
Could not agree more. I thought UDT's were great but this method further extends their usefulness.
UDT is like simplier Class in VBA, can be really convenient, if methods are not needed :)
Phil - great video as always, many thanks. I have to ask - where did you get the cool Access T-shirt?
Thank you, John! The T-shirt was a gift from Microsoft at the Access DevCon 2019 conference in Vienna, Austria. BTW: Registration for Access DevCon 2022 just opened last week. Take a look at the agenda if you like: www.donkarl.com/devcon/agenda.htm
Due to Covid, it has to be a virtual conference this year.
Interesting I didn't that it's posiible to create UDT in VBA like the ones in Go, C or C++ programming languages. I'll find a projecto to use it.
Does the ThePerson UDT argument must be passed ByRef to the callee procedure as shown in your code ? if not, does it make any difference to pass the UDT argument ByVal vs ByRef ?
ByVal vs ByRef is always the same. ByVal will copy the value passed into the parameter. ByRef passes the memory reference to the parameter of the function.
Never try to use UDT and Collections together)
Can you even put a UDT into a collection?
Why is that? And what about using them in an ArrayList??
Why did you declare Person type as private If you want to pass a person parameter to the declared public function? This must throw a compiler error
Did I? If I did it would indeed be an error. Luckily the compiler would catch it right away.