Function after data update

  • Thread starter Thread starter tcb
  • Start date Start date
T

tcb

On the onopen event of a form I would like to have code that runs only
if any data within in one specific table has been updated since the
last time the form was opened. The table does not currently have a
modified on datetime field, and I'd rather not create one in this case.
 
You need to start by asking yourself "How do I know that data has
changed?" then you need to tell your form how to recognize that the
data has changed and tell it what to do if it has.

You would not first ask your form "Has my data changed?" because it's
reply would be "How would I know, you haven't told me HOW to tell if
it's change or not!". (BTW, you might as well have done this as make
the post that you made... because I have no idea either)

If you are still stumped then you should post HOW YOU KNOW that your
data has changed. Examples of table structure and any queries that
may be involved are always helpful in describing a problem as well.

Cheers,
Jason Lepack
 
When you create or modify a table you know those dates. Is there a
date associated with any time data within the table was edited,
updated, deleted, or appended? Even if I know when the table was last
opened or closed would be good enough for me in this case.
 
Nope.

Data is Data... What you put in is what you get out.

What is this "other code" that you need to run? If for some reason
you are requiring to run "other code" to modify your data periodically
then that screams of bad design. Maybe you could be helped in that
case.
 
Well yes, I can't disagree with you about the screams. You hit the
nail on the head. There's nothing I can do about that. This database
was poorly designed and many things that I try to do would not be
necessary if it was fully normalized, relational, etc. etc. It would
take more time than it is worth to describe the problem in detail.
Sometimes you just have to work with what you have in hand. Anyhow I
found a fairly reasonable solution. Meanwhile plans to completely
redo this app are on the drawing board now. Thanks for your time!
And sorry for the bother.
 
I'm glad ou found a solution that will work for now. I also applaud
you for moving towards a redesign.

Cheers,
Jason Lepack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top