Automatically running a macro from a form

  • Thread starter Thread starter Rebecca Hooker
  • Start date Start date
R

Rebecca Hooker

I am entering details for a student on a subform, and am
trying to get it to run a macro as soon as I leave the
fundcode field which will then update the rest of the
fields dependent on a particular value.
I have a command button which does this, however, when i
use the on exit/or on lost focus property for the field to
run exactly the same macro it does not recognise the
record exists yet and so does not update it.
when pressing the command button it appears to save the
record to the underlying table first, but still recognises
the record I want to update, how can i do this by using
the properties instead?
 
In the code you execute you could first set the form.dirty property to
false. This will save the record.
 
Thanks for your reply, but am still having trouble as am
not sure how i would set the form property.

I have tried to amend the form.dirty property by using
SetValue in the macro by referencing the form and setting
the expression as false, but when the macro runs it says
the object does not contain the automation object dirty,
which makes no sense to me at all! I realise that I maybe
making very little sense sorry!
 
Back
Top