display in the form

R

Raymond Chiu

Dear all,

(1) Why some textbox values or label caption does not update on the form
when the value change?

me.lblstatus.caption=" XXXX"
.....Processing
me.lblstatus.caption="12344"
..,....Processing

(2) The recordcount does not show true value. The recordcount is always less
than one value of absoluteposition recordset. After movenext, they all
increment one. Why?
set rs=currentdb.openrecordset ( cSQLString, dbopendynaset )
me.progressbar1.value =( rs.abosoluteposition/ rs.recordcount) *100
 
W

Wayne Morgan

1) I don't see enough information here to answer your question. What are you
using to trigger the code and make it run?

2) The RecordCount is less than the AbsolutePosition? I would expect it to
be the other way around. If you are at the last record, the AbsolutePosition
should be one less than the RecordCount. The AbsolutePosition is zero based.
From the help file:

"The setting or return value is a Long integer from 0 to one less than the
number of records in the Recordset object. It corresponds to the ordinal
position of the current record in the Recordset object specified by the
object."
 
A

Allen Browne

Issue 1
Access considers running your code to be a higher priority task than
updating the screen. To force a screen update earlier:
Me.Repaint

Issue 2
RecordCount shows only the number of records accessed so far (except for
recordsets of type dbOpenTable). To force Access to load all the records and
give you the correct count with:
rs.MoveLast

Just a general tip: if it's possible to perform whatever updates you are
doing here via an Update Query, that may be faster.
 
R

Raymond Chiu

Dear allen browne,

Thanks for your big help
My program seems to be wonderful for your help


Thanks,
 

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