Avatar of cazink
cazink
Flag for United States of America asked on

Making a new instance of ...

in visual basic one is to make and use what is referred to a 'new instance' of an object. in access we can do the same thing. then we can give that new object properties. as an example: if i make a new employee then give it properties such as fname, lname, bdate, etc. then i believe i have the following: employee.fname, employee.lname, and employee.bdate. apparently this type of object construction is frequent in visual basic. one of the advantages, as i understand it, making changes is easier through out the code. what i am asking in this question is how can i utilize this in access. again i know i can create a new object and the give it properties, but how can i incorporate this into a table and other access objects. is there some teaching on this specific topic.
Microsoft Access.NET Programming

Avatar of undefined
Last Comment
Jeffrey Coachman

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
IrogSinta

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Patrick Matthews

You might also want to review this: https://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/A_3802-Parent-Class-Builder-Add-In-for-Microsoft-Excel.html

It is an add-in I created for Excel that makes it easier to create class modules, especially when you have classes with "parent" and "child" relationship.  For example, in your case you might have a "parent" class clsEmployees, with members of "child" class clsEmployee.

While it is built for Excel, the add-in can export the code as *.cls files, which you can then import into your Access project.
Scott McDaniel (EE MVE )

If you're referring to Objects in VB.NET, then understand that Access doesn't behave the same as .NET. You can build classes and such that work as the other Experts have described, but the environment in Access does not translate over to the environment in .NET.

With that said - you can do quite a lot with classes and such in Access, and you'll find that working with classes in Access is similar to other environments. Access/VBA doesn't support higher-level class methods like Inheritance and such, but it's rare that you truly need those (and if you do, you probably should be working in .NET anyway).
Jeffrey Coachman

<If you're referring to Objects in VB.NET, then understand that Access doesn't behave the same as .NET. You can build classes and such that work as the other Experts have described, but the environment in Access does not translate over to the environment in .NET.>

Correct, if you are starting out in the .Net world, then this is the way that might be most common
In MS Access, ...not so much...
I have been building Access app for over 10 years and have only done this a few times.
That is not to say that I could not have used one, ...only that I never had a real need.

Can you state your ultimate goal here in terms of what you are trying to accomplish.
(Not terms of the technology)
because this is unclear:
<if i make a new employee then give it properties such as fname, lname, bdate, etc. then i believe i have the following: employee.fname, employee.lname, and employee.bdate. apparently this type of object construction is frequent in visual basic.>
...I am not so sure I understand the context here...
If you want to creates a new employee (In MS Access), this is typically done as a "Record", not as an instance/class.

Since you posted this Q to both the MS Access and .Net Topic areas, you need to tell us what parts of this Q relate to MS Access and what parts pertain to .net.

JeffCoachman
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck