Macro running when a field changes

  • Thread starter Thread starter Mike Waters
  • Start date Start date
M

Mike Waters

Hello,
This may sound like a strange request, but is there a
wat to get a macro to run in a query when a field is
changed? My current employer uses Access for inventory
control, and they have me doing the updates using a
query. I'm working on improving the system in my spare
time, but there are somethings I'm having trouble with.
What I'm looking to do is create a macro that will copy a
row from a query and paste it in a table for later use.
That part I think I can do, the part I have no idea how to
do, is to get this macro to automatcally run when there is
a change in the information. is there anyway to get this
to happen. An example would be when I lower the quantity
of an item, that line is then coppied and pasted into a
table so when I'm done, I can do a repot of all the
changes that were made. If anyone has any suggestions,
please E-mail me at (e-mail address removed)

Thank You
MIke
 
What would happen if you change multiple items in a record? Would you want
it to create multiple entries into this temp table? Or are you trying to
keep track of every change to every field? If so then instead of copying
the row you should only copy the name of the field, the old value, the new
value, and maybe the date incase you wanted to knwo when the change took
place. This would involve using VBA.

Instead of copying the data into another table, how about adding another
column (Yes/No) to your current table to keep track of changes. Then use
the AfterUpdate event of the text box to change this to Yes. Then you can
base your reports on records with this Yes. Or you can use a date field and
filter based on the date or a range of dates incase you want to print
multiple days of entries. Pick something that would be appropriate for your
situation. Changing multiple fields won't cause problems either.

Kelvin
 
Back
Top