data not refrshing

adaniele

Registered User.
Local time
Tomorrow, 08:49
Joined
Jul 18, 2005
Messages
176
hey, guys.......this should be very simple, but i am missing something.

i have 2 forms, 1 subform and a query in a 97 access DB.
The query was designed to show records where the status is Submitted only. IT WORKS.

The subform gets the data from the query. IT WORKS

the form A, has the subform with a list of records with submitted status. When a user double click in the record number , a new form B is open with the details. IT WORKS

The form B, shows the details of the record selected in the previous form A. In this form (B), a user can change the status and save the change, so , when the form B is closed, the form A with the list of records coming from the subform, is updated, and the modified record is not there anymore. IT WORKS.

The problem is that i replicate the same in a new access db, but in a 2003 DB and it DOESNT work.
When the form B is closed after modifying the status, the form A with a list of records coming from the subform, still showing the modified record with the new status. It means that the data is refreshed but for some reason the query still shows the wrong record.

i tryed with a refresh button, but an error msg comes."the refresh command is not available now"

any idea?
thx, max.
 
well ...... i could refresh the data with a refresh button. But i still trying to understand why it doesnt do it by itself, like in the access 97 db.

thx.
 
Me.Parent.Refresh

Place that on your last command button or something. Like if you have an enter button, or a save button. Put it in the code at the end (or rather before the end)

ex:

Private Sub Command32_Click()
On Error GoTo Err_Command32_Click


DoCmd.GoToRecord , , acNext
DoCmd.Requery
Me.Parent.Refresh

Exit_Command32_Click:
Exit Sub

Err_Command32_Click:
MsgBox Err.Description
Resume Exit_Command32_Click

End Sub

Let me know how you do.
 
king, thx for your hlp.

I added the: me.parent.refresh command before closing the form B, but i got the following error.
"run time error 2452
the expresion you entered has an invalid reference to the parent property"

thx, max.
 
Alright...maybe I misunderstood what your situation is.

Do you have a subform embbedded in your main form, and you are trying to refresh the main form? That's where "Me.Parent.Refresh" would work, and what I thought you were trying to accomplish.

Another option is to put a "refresh button" on the form (as you had noted), make it invisible and attach a macro to use it on your "enter or save" buttons.

Example:

You enter a persons name and address in the fields, and then hit "save".

Have a macro attached to the "save" key which automates your invisible "refresh" command button.

Same results...different way. And you still wouldn't have to actually "hit" or see the refresh button.
 
Last edited:
thx, sam and pat. great ideas both. now it is working.
max.
 

Users who are viewing this thread

Back
Top Bottom