display in the form

  • Thread starter Thread starter Raymond Chiu
  • Start date Start date
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
 
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."
 
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.
 
Dear allen browne,

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


Thanks,
 
Back
Top