Form Refresh

mosh

Registered User.
Local time
Today, 06:47
Joined
Aug 22, 2005
Messages
133
Hello All,

I currently have a form that has 4 subforms but I require a Refresh function that refreshes every single form. I have tried creating individual refresh buttons for each form but doesn't seem to work.

Any help appreciated.

Thanks

Mos
________
Susanalady
 
Last edited:
Refresh only refreshes changes to the existing data - it doesn't add records that have been added. To get that use Requery.
 
Refresh only refreshes changes to the existing data - it doesn't add records that have been added. To get that use Requery.

So Requery refreshes the data on the form?

thanks
________
Laguna Bay Condominium
 
Last edited:
Yes - here's the Access Help File info on it:
Access Help File said:
The Refresh method shows only changes made to records in the current set. Since the Refresh method doesn't actually requery the database, the current set won't include records that have been added or exclude records that have been deleted since the database was last requeried. Nor will it exclude records that no longer satisfy the criteria of the query or filter. To requery the database, use the Requery method. When the record source for a form is requeried, the current set of records will accurately reflect all data in the record source.
 
Esentially yes. it will relook at the values in the query and show them
 
Esentially yes. it will relook at the values in the query and show them

ok, so Can i use the following to requery each form?

Private Sub Form_Current()
Dim rst As Recordset
Set rst = Me.RecordsetClone
Forms![AIA].Requery
End Sub

Thanks

Mos
________
Paxil Lawsuit Information
 
Last edited:
ok, so Can i use the following to requery each form?

Private Sub Form_Current()
Dim rst As Recordset
Set rst = Me.RecordsetClone
Forms![AIA].Requery
End Sub

Thanks

Mos

Just use this Forms!YourMainFormNameHere.YourSubFormCONTAINERNameHere.Form.Requery
And to refer to the main form - Forms!YourMainFormNameHere.Requery
And from the form itself Me.Requery
 
Just use this Forms!YourMainFormNameHere.YourSubFormCONTAINERNameHere.Form.Requery
And to refer to the main form - Forms!YourMainFormNameHere.Requery
And from the form itself Me.Requery

Thanks for the reply;

so basically in the mainform:

YourMainFormNameHere.YourSubFormCONTAINERNameHere.Form.Requery
Forms!YourMainFormNameHere.Requery

Subform:
Me.Requery

Are these placed in the AfterUpdate option of the forms?

Regards
________
Web shows
 
Last edited:
Thanks for the reply;

so basically in the mainform:

YourMainFormNameHere.YourSubFormCONTAINERNameHere.Form.Requery
Forms!YourMainFormNameHere.Requery

Subform:
Me.Requery

Are these placed in the AfterUpdate option of the forms?

Regards

Make sure to change the names so they match your form names... you can do it in one button located on your main form. seeing as you were using a button in the beginning
 
Make sure to change the names so they match your form names... you can do it in one button located on your main form. seeing as you were using a button in the beginning

Would it be better to have it under AfterUpdate on the form?

mos
________
Avandia settlements
 
Last edited:
After update of which form? your main form? what exactly is happening for you to need them to requery?
 
After update of which form? your main form? what exactly is happening for you to need them to requery?

the Main form and subforms are based on queries. When I add a record on the form I wanted a refresh function but obviously could not do it as the forms are query based. A record is added and the subform contains a query that looks at which employees are off on that day thus update in that query is required.

mos
________
AlwaysOnTop live
 
Last edited:
ok so do u have a save record button on your main form? if so you can do the requeries in that
 

Users who are viewing this thread

Back
Top Bottom