PDA

View Full Version : Basic Refresh Problem



igendreau
05-05-2010, 11:59 AM
I have a form that lists Orders (frmOrders). I have a button in the detail section that allows the user to open another form with some additional order details (frmOrderDetails), and they can also edit fields in that screen. When they my Exit button on frmOrderDetails, it closes that form, and leaves you looking once again at frmOrders.

Here is my problem. A few fields appear on both forms. For instance, DeliveryDate. If someone goes into frmOrderDetails and updates the DeliveryDate field, when they click exit, I want that new DeliveryDate to be appearing on my frmOrders screen. I thought it'd be as simple as attaching the following to my Exit button:

Forms!frmOrders.Refresh

It seems to work fine for me, but I have complaints from users who say that they still don't get a refreshed screen until they exit out and open frmOrders again. Doing a .Requery definitely works, but it also undoes any sorting or filtering the user has already done, so I'd like to skip that.

If someone can tell me how to make certain that the frmOrders form is correctly being refreshed, I'd greatly appreciate it. Thanks!

Imdabaum
05-05-2010, 01:50 PM
One possible solution is to set the value on frmOrders from frmOrderDetails.


Sub [OnClose Event]

frmOrder.DeliveryDate = frmOrderDetails.DeliveryDate

End Sub

I'm assuming that both forms hit the same table just display different views. Right?

igendreau
05-06-2010, 05:54 AM
Yes, both forms are pulling from the exact same query actually. But frmOrders only shows a handful of the fields in that query, and frmOrderDetails shows all of them.

Imdabaum
05-06-2010, 09:34 AM
I don't suppose you want to post a dummy sample of what you are doing so someone else can test it. Export the dependent forms, queries, and table (definitions only-to keep data secure) into a dummy.mdb or accdb file. Then we can create data and test it. Or you can populate a few dummy data samples. When I can't see an obvious solution I always try to get my head into the app to see how it works.