Refresh, Repaint, Recalc, Requery...Nothing Works!

B

bw

Ok, I'm getting really confused.

Private Sub chkEbay_AfterUpdate()
Forms!PARTSFORM.Refresh
Forms!PARTSFORM.Repaint
Forms!PARTSFORM.Recalc
Forms!PARTSFORM.Requery
End Sub

As I STEP through this when I change chkEbay, the first three (Refresh,
Repaint, Recalc) do nothing. The last one (Requery) DOES update the
form...but it then immediately goes to the record number 1. This confuses
me
to no end, as a Help on Requery has the following statement: "Note The
Requery action does not affect the position of the record pointer."

But as I said, the record pointer is changed to the first record.
So can anyone help guide me to get the form updated with new calculations,
and stay on the same record?

Thanks,
Bernie
 
M

Marshall Barton

bw said:
Ok, I'm getting really confused.

Private Sub chkEbay_AfterUpdate()
Forms!PARTSFORM.Refresh
Forms!PARTSFORM.Repaint
Forms!PARTSFORM.Recalc
Forms!PARTSFORM.Requery
End Sub

As I STEP through this when I change chkEbay, the first three (Refresh,
Repaint, Recalc) do nothing. The last one (Requery) DOES update the
form...but it then immediately goes to the record number 1. This confuses
me
to no end, as a Help on Requery has the following statement: "Note The
Requery action does not affect the position of the record pointer."

But as I said, the record pointer is changed to the first record.
So can anyone help guide me to get the form updated with new calculations,
and stay on the same record?


Most likely, none of those are appropriate for whatever
you're trying to accomplish.

Refresh picks up any changes to the records in the form's
recordset that might have been made by other users.

Repaint only redisplays the form incase some update did not
display immediately.

Recalc forces an immediate calculation of any controls that
have an expression in their ControlSource property.

Requery totally reruns the form's RecordSource table/query.
Regardless of what Help says, since the recordset can be
different than it was before, the current record might not
even exist anymore, so resetting it to the first record
makes at least a little sense. In some cases, it makes
sense to want to retain the same current record, in which
case you should save the current record's primary key value
and use FindFirst to re-locate the record.

Now, if you'll explain what you're trying to accomplish,
maybe someone will be able to suggest an appropriate way to
do it.
 

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