Refreshing Forms

Dina01

Registered User.
Local time
Today, 14:45
Joined
Apr 24, 2002
Messages
87
Hello

I have a form named " Agrassion_form", and when I click on the OK button it saves the data in my table named Data_tb..

After everything is saved I would like for my data to close the current form and automatically update my other form..This is my code..

' Close the current form
DoCmd.Close

' Open the Main Form
DoCmd.OpenForm ("PCV_Dispatch_form")
DoCmd.Requery ("PCV_Dispatch_form")

I don't want to put a timer on the Main Formbecause it caused too many problems....

This application is a multi user application therefore everytime there is a change made to the tables I need to make sure that all users see the changes......Can anyone please help me............
 
I think whats happening is when the first line of code is fired. it closes the form of your choice and the rest of the code doesn't fire.

Try re-entering your code the other way around.

Open the form of choice, then close the other form after.

Have a look at the attachment.

you shouldn't have to requery on opening the form because it should return the last record any way.
Check your table and create an index setting the sort order to descending.

That should do the trick.

Dave
 

Attachments

Users who are viewing this thread

Back
Top Bottom