473,802 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Keeping track of changes in VBA Classes

Hi all,

I'm working on an application in which I already make some
preparations to be able to work in a frontend and backend database,
even if this isn't the issue a this moment. I'm using VBA classes for
this (I know not the easiest way, but I have made some considerations
and I want to to it this way as VBA classes are some new stuff to
explore for me).

In a class 'client' I get the data from the database and put it in
some class variables. I use these variables to fill the textfields of
my unbound form. To avoid to update the database on every view of the
data by a user, I want to keep track of the changes a user made or
didn't make to the data displayed. I any changes were made an update
of the table is done, otherwise not.

I could use an 'afterupdate'-event on every input field on my form,
but I'm wondering if I could do this on a shorter way.

Does anyone has any ideas.

Thanks.

De_Ciise

Feb 27 '07 #1
2 3396
De_Cisse,

You could put the functionality in your classes and set an IsDirty property.
You would of course have to be able to persist the original property values
and see if they are all the same as the updated values.

-- Bill

"De_Cisse" <fr************ *****@gmail.com wrote in message
news:11******** **************@ s48g2000cws.goo glegroups.com.. .
Hi all,

I'm working on an application in which I already make some
preparations to be able to work in a frontend and backend database,
even if this isn't the issue a this moment. I'm using VBA classes for
this (I know not the easiest way, but I have made some considerations
and I want to to it this way as VBA classes are some new stuff to
explore for me).

In a class 'client' I get the data from the database and put it in
some class variables. I use these variables to fill the textfields of
my unbound form. To avoid to update the database on every view of the
data by a user, I want to keep track of the changes a user made or
didn't make to the data displayed. I any changes were made an update
of the table is done, otherwise not.

I could use an 'afterupdate'-event on every input field on my form,
but I'm wondering if I could do this on a shorter way.

Does anyone has any ideas.

Thanks.

De_Ciise

Feb 27 '07 #2
Well, since you using class object, one of there GREAT features is that you
can multiple instances of that object.

So, right after you load the record, cerate another instance of the object,
and have that load up the same values.

then, your update routine can simply check if any of the values loaded have
changed.....

The problem here becomes that each "property" of a class object in ms-access
is not added to some built in collection.

However, What this means is that I would build the class object with a
"field" collection, and not actually write a separate let/get for each new
field (really, if you have to write new code for each control/field you add
to a form, you going backwards to the stone age in terms of productivity,
and wasted developer time). With a medium sized application having a 160
forms, the maintains nightmare here would be incredible.

Further more, you do realize that form is a class object and all of the
controls etc. that you place on a form are already in a object for you!!!
(so, there is only pain, and wasted developer time if you try and code your
own object when ms-access makes one for you!!). do realize that you can have
multiple instances of the same form in memory? (the reason for this is that
each form is a object). And, you do realize that property get/let code can
be placed into a forms code module (and, functions declared PUBLIC in a
forms module become methods of the form - and, inteli-sense will even work
when you do this!!!).

Using a object to just store data from a form makes very little sense when
that same data is in the form......

However, as you said, you doing this much for learning. So, to simply check
for changes in data, simply as mentioned make a copy of your object right
before you allow edit. When the user is done on the form, check each value
for a difference (this actually what ms-access does internally anyway for
you -- it just that you are coding what is built in).
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com
Feb 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3093
by: Sandman | last post by:
Just looking for suggestion on how to do this in my Web application. The goal is to keep track of what a user has and hasn't read and present him or her with new material I am currently doing this by aggregating new content from all databases into a single indexed database and then saving a timestamp in the account database (for the current user) that tells me when the user last read items in the aggregated database.
7
2063
by: BarryS | last post by:
Hi All: We're rolling out 3 DB2 (8.2 on LUW) platforms for branch offices, each of these are going to have the same schema. These are all going to be non-federated systems. I need some advice / pointers on keeping the DDL's in sync with each other. I'm going to have a development machine in my office that I first apply any schema / stored-procedure changes to, then would like to roll out
9
2022
by: DBQueen | last post by:
Is there an easy way to keep track of which modules I've worked with day by day. I'd like to see a log of what items I "affected" - so that when a database goes sour I can easily see what changed from the previous version (my feeble mind can't retain all of this, especially when a week passses before getting back to a project). Is there a log mechanism within Access or is there some sort of support software someone can recommend which...
9
5493
by: Alfred Taylor | last post by:
I'm testing the waters of n-tier development and I ran into a scenario that I'm not sure what the best solution would be. I have a Company object which contains a collection of contacts retrieved from a database. In the presentation layer, the user will be able to add/delete/modify this collection in which case it needs to be synced with the database. The question is basically how best to do this? Aside from overriding the add/remove...
5
4041
by: Daniel Walzenbach | last post by:
Hi, I need to track all changes made to an object. Consider the following class: Public Class Dog
0
787
by: Jerry Spence1 | last post by:
I am starting a thread in the usual way as follows: Sub StartThread (ByVal CameraName as String) Dim t As New Thread(AddressOf Frm1.GetPicture) t.Name = "GetPicture" & CameraName t.Start() End Sub
2
2770
by: metaperl | last post by:
I'm actually taking Microsoft's 2779 and just finished a lab where we kept track of our changes to the database. However, I'm not happy with the scripts interface because it does not tell me the chronological order of my changes to the database. Could someone share with me their technique for keeping track of database changes? I'm actually thinking a set of tables would be best, because sometimes
10
2286
by: Karlo Lozovina | last post by:
Hi, what's the best way to keep track of user-made subclasses, and instances of those subclasses? I just need a pointer in a right direction... thanks. -- Karlo Lozovina -- Mosor
3
4198
by: dirksza2009 | last post by:
Hi, I've made a multi user (4 end users) database in Access 2000. I've made data tables, reference tables etc which sits on a shared drive and I've made individual front ends for the end users which gives them specific views of the data. I'd like to track all the changes made to a record which works find with the following code : basAuditTrail: Option Compare Database Const cDQ As String = """" Sub AuditTrail(frm As Form, recordid As...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10305
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.