To Requery or Repaint?

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
 
M

Marshall Barton

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
 
J

johnb

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
 
M

Marshall Barton

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
 

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

Top