0

I am reading a text file with many thousands of records. Each record is evaluated and depending on the results of that evaluation a procedure is followed. For the purpose of this exercise, it is irrelevant what the procedures do. I have created a Progress bar which is working perfectly. However, at the start of the process, I try to display the start time in either a TextBox or Label. Also, after reading each record, I increment a record count and calculate the elapsed time. Before retrieving the next record I try to display the calculated results, for example:

```
tbxStartTime = Format(Now, "dd/mm/yyyy, hh:mm:ss")
tbxRecordCount = RecordCount
tbxElapsedTime = ElapsedTime
```

But nothing displays. The progress bar displays correctly. When all the records have been read the relevant TextBox's display the calculated values.

How do I display the values in the TextBox's dynamically while the program is running?

Gggggggg
  • 31
  • 4
  • Does it help if you insert `DoEvents` after these three lines? – GSerg Jan 23 '21 at 18:10
  • I am a self-taught VBA user, and I'm not aware of DoEvents. So thank you, I will Google DoEvents and let you know. Joe – Gggggggg Jan 24 '21 at 04:20
  • 1
    Yes, That worked. It slowed things down a bit but, as the display is there in a way just to let me know how things are progressing, I can initiate DoEvents every 10th record without losing the spirit of the observation. So thank you. Not certain how to formally thank you. Regards Joe – Gggggggg Jan 24 '21 at 06:54

0 Answers0