To Requery or Repaint?

  • Thread starter Thread starter johnb
  • Start date Start date
J

johnb

Hi All
I have a form with many controls and a popup form. I use the popup form to
make changes to data in the main forms underlying tabel.

I've been trying to get the popup form's "On-Close" event to requery the
main form to show thoses changes without success.

What is correct method to requery/repaint a form from a popup form?

TIA
johnb
 
johnb said:
I have a form with many controls and a popup form. I use the popup form to
make changes to data in the main forms underlying tabel.

I've been trying to get the popup form's "On-Close" event to requery the
main form to show thoses changes without success.

What is correct method to requery/repaint a form from a popup form?


First the pop up form must save any changes to the data, the
the requey can retrieve the changed data. I think you want
something like:

If Me.Dirty Then Me.Dirty = False
Forms![main form].Requery
 
Hi Marshall
Thanks for the missive.

I don't understabd the Me.Dirty bit. In the popup form OnClose event I've
tried to requery my main form with
Forms!frm_Room_Occupancy_Layout_Order.Requery. Without any impact

Marshall Barton said:
johnb said:
I have a form with many controls and a popup form. I use the popup form to
make changes to data in the main forms underlying tabel.

I've been trying to get the popup form's "On-Close" event to requery the
main form to show thoses changes without success.

What is correct method to requery/repaint a form from a popup form?


First the pop up form must save any changes to the data, the
the requey can retrieve the changed data. I think you want
something like:

If Me.Dirty Then Me.Dirty = False
Forms![main form].Requery
 
Pursuing my guess that the changed record has not been saved
when you do the requery...

Setting Me.Dirty = False forces the changes to be saved.

(The Dirty property is True when the record was edited.
Setting Dirty to False means that the record must be saved,
otherwise Dirty would be True)

Try it and see if it helps.
--
Marsh
MVP [MS Access]

I don't understabd the Me.Dirty bit. In the popup form OnClose event I've
tried to requery my main form with
Forms!frm_Room_Occupancy_Layout_Order.Requery. Without any impact

Marshall Barton said:
johnb said:
I have a form with many controls and a popup form. I use the popup form to
make changes to data in the main forms underlying tabel.

I've been trying to get the popup form's "On-Close" event to requery the
main form to show thoses changes without success.

What is correct method to requery/repaint a form from a popup form?


First the pop up form must save any changes to the data, the
the requey can retrieve the changed data. I think you want
something like:

If Me.Dirty Then Me.Dirty = False
Forms![main form].Requery
 
Back
Top