Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use text box to display status of process

Status
Not open for further replies.

WaltW

MIS
Jun 14, 2000
130
US
I have a simple form that contains a couple text boxes and a command button. The command button, when clicked, runs VBA code that imports data into the Access database from a series of Excel files. One of the text boxes on the form is supposed to be a status display - it shows the name of the Excel file as it is being processed. I can't seem to get the text box to work right - if I just set the value of the text box in the VBA code to the name of the Excel file for each Excel file accessed, nothing ever displays. If I set the focus to the status text box before assigning the text value, it does display the filename, but in highlighted text (which I don't want). And this only works until I get a message from Excel requiring operator intervention ("Do you want to save changes?" or something like that) - after this message appears, nothing displays in the text box afterward.

I'm obviously missing something - any suggestions for helping me get this to work right would be very much appreciated. Thanks!

Walt
 
Have a look at the DoEvents function:
Me![status text box] = "name of the Excel file"
DoEvents
' process the Excel file

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, PH. The DoEvents function worked perfectly, though I can't say I understand fully why it's necessary. Does the fact that DoEvents fixed the problem mean that before adding DoEvents, the VBA program was too busy doing other things to actually update the screen display?

Walt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top