data refresh when switching between two forms

pavlos

Registered User.
Local time
Today, 21:21
Joined
Mar 10, 2009
Messages
79
Hi,

I use the "contact management database" template from access 2007. When the database opens both forms "Contact list" and "Contact details" are set to open in a non pop up mode. The database is set up to display tabbed documents.

When I add a new contact in the "Contact details" form and after saving it I switch to "Contact list" form and view it. Unfortunately, the form does not show it unless the refresh all is clicked. Is there a way to automatically refresh the "Contact list" form when I switch to it?

So far i red various articles and tried to fix it without success!! I am not good at access!! :o

Regards,
Pavlos
 
do forms have a GOTFOCUS() event? I think they do! If so, on the contact list's focus event, put this:
Code:
me.requery
that should to it
 
Dear Adam,

Thanks for replying. I typed me.requery in the On Got Focus field of the "Contact list" form but still does not refresh the form! Any further suggestion for solving it would be very much appreciated!

Regards,
pavlos
 
Forms only have a "GotFocus" event if they contain no controls that can receive focus. They do. however, have an Activate event that may be what you need.

Try
Code:
Private Sub Form_Activate()
  Me.Requery
End Sub

on the form you're returning to.
 
Thanks for the correction Linq. Sometimes I leave it up to the OP to experiment with what I am out of touch with, or don't have time to look up myself! :)
 
Thanks Linq, the Activate event solved the problem!

Also, i would like to thanks Adam for the initial reply!

Kind regards,
Pavlos
 

Users who are viewing this thread

Back
Top Bottom