Refresh form contol when record has changed in a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a yes/no fieldA in a tableA. I have an unbound controlA in formA using
dlookup to get the yes/no value from a particular record in tableA. This
works great.

My problem is that if a user opens tableA and changes the yes/no value,
while formA is still open, I need controlA to immediately reflect the change.
It will currently only refresh if I close and reopen formA. ControlB on
formA calculates depending on the yes/no field value in tableA and I need
that value to change if the yes/no value in tableA changes. I've created a
macro that requeries controlA and ran the macro in the on current of formA
but that doesn't work. Is there a way I can do this?

My on current code is: DoCmd.RunMacro "RequeryGateway3", 1, 1

Thanks much -
Alex
 
Alex said:
I have a yes/no fieldA in a tableA. I have an unbound controlA in formA using
dlookup to get the yes/no value from a particular record in tableA. This
works great.

My problem is that if a user opens tableA and changes the yes/no value,
while formA is still open, I need controlA to immediately reflect the change.
It will currently only refresh if I close and reopen formA. ControlB on
formA calculates depending on the yes/no field value in tableA and I need
that value to change if the yes/no value in tableA changes. I've created a
macro that requeries controlA and ran the macro in the on current of formA
but that doesn't work. Is there a way I can do this?

My on current code is: DoCmd.RunMacro "RequeryGateway3", 1, 1


No good way to do this.

You have to execute the DLookup to get the changed value. I
suppose you could do that in the form's Timer event, but
that seems like a lot of overhead to deal with users going
around to the back door and editing a table they shouldn't
even know exists.
 
Back
Top