[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Form not displaying recordset RowCount

The code below does give me the RowCount, but it only appears on the form when I step through the code.  What do I need to do to have teh form upate with the intCount number before it starts processing the Do While loop?  The intItem in the loop updates correctly as each item is processed, but the total number for intCount does not appear.
'Need to move to last record to get rowcount and then back to start of recordset
    rsEmployees.MoveLast
    intCount = rsEmployees.RecordCount
    Forms!frmProcessing.txtItems = intCount
    rsEmployees.MoveFirst

    Do While Not rsEmployees.EOF
    intItem = intItem + 1
    Forms!frmProcessing.txtItem = intItem  'Update count of number of items processed

Open in new window

0
ssmith94015
Asked:
ssmith94015
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:

  rsEmployees.MoveLast
    intCount = rsEmployees.RecordCount
    Forms!frmProcessing.txtItems = intCount
    rsEmployees.MoveFirst

    Do While Not rsEmployees.EOF
    intItem = intItem + 1
    Forms!frmProcessing.txtItem = intItem  'Update count of number of items processed
    DoEvents ' add this
0
 
ssmith94015Author Commented:
Updates as wanted, thanks.

Sandra
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now