What is difference between F9 and Shift+F9 in Access?

G

Guest

What is difference between F9 and Shift+F9 in Access?

I created a form with a subform. I also have a text box on the form with a
dsum formula. The Dsum will calculate a total of the record that have a
check box in the subform checked. When you click on the check box to select
or deselect a record. the text box will recalculate if I press F9 but not if
I press shift+F9. I tried adding recal, requery, and repaint as events to
update the formula with no avail.
 
G

Guest

<F9> recalculates the fields in the window. <SHIFT><F9> requeries the
underlying tables. If the focus is on the subform, then <SHIFT><F9>
requeries the underlying tables for the subform only.

To get the text box on the main form to automatically recalculate the number
of records checked, try the following in the subform's check box's
OnAfterUpdate( ) event:

Private Sub chkDone_AfterUpdate()

On Error GoTo ErrHandler

Me.Parent.Controls!txtSum.Requery

Exit Sub

ErrHandler:

MsgBox "Error in chkDone_AfterUpdate( ) in" & vbCrLf & _
Me.Name & " form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & Err.Description
Err.Clear

End Sub

.. . . where chkDone is the name of the check box on the subform, and txtSum
is the name of the text box on the main form.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top