Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Refresh issue 1

Status
Not open for further replies.

molly

Technical User
Jul 17, 2000
219
US
My subform does not update refresh itself after a change.
I have tried this 2 ways. First as a double click on one of the fields on the subform. Now i tried as a single click command button outside the subform (see below)

Private Sub Command321_Click()
DoCmd.OpenForm "frmSCP", acNormal, "", "", , acNormal
DoCmd.GoToControl "txtFormulaID"
DoCmd.FindRecord FormulaID, acEntire, False, , False, , True
End Sub

The Qry works fine with the table change. However, the subform is stubborn. It only shows the correct value if i exit the file and come back in.

Can you help me? thanks Molly
 
FYI. I read more of your website issues about a subform refresh. i added a line shown far below. it still does not refresh it, however, if i manually click on "Records, Refresh" at the top menu bar, it works. so i must be close. Please advise. thanks alot. Molly


Private Sub Command321_Click()

DoCmd.OpenForm "frmSCP", acNormal, "", "", , acNormal
DoCmd.GoToControl "txtFormulaID"
DoCmd.FindRecord FormulaID, acEntire, False, , False, , True

[sfrmExpectedProfit].Form.Refresh

End Sub
 
thank you. the me.requery worked in both my button and also in the double click field.

i liked the way you explain this in simple terms. i made a "remark" note next to the statement. you said so much in so few words.
molly
 
The best way to ensure your subform always matches tour main form is to use the Link Child and Link Master fields of the subform control (this is the thin box around the subform, not the form inside it). If you add a subform using the wizard (ensure the 'wand' on the toolbox is selected), it will prompt you for Link Child and Link Master fields. You could also study the Northwind sample database that ships with all versions of Access.

===============
Requery

The Requery action does one of the following:

* Reruns the query on which the control or object is based.
* Displays any new or changed records, and removes any deleted records from the table on which the control or object is based.

Controls based on a query or table include:

List boxes and combo boxes.
Subform controls.
OLE objects, such as charts.
Controls containing domain aggregate functions, such as DSum.

If the specified control isn't based on a query or table, this action forces a recalculation of the control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top