A
alex
Refresh unbound textbox
Hello,
Using Access ’03…
I have quite a bit of VBA code that runs a variety of queries.
Between all of the SQL code, I display information to the user in an
unbound textbox on the form. Something like this:
‘’’’’’’’’’’’’’’’’’’’’’’’’
Sub RunQueries()
Me.unboundTextBox = “About to run queries”
Me.unboundTextBox = “Running Query A”
Docmd.runsql(queryA)
Me.unboundTexBox = “Running Query B”
Docmd.runsql(queryB)
…
Me.unbountTextBox = “Running Query Z”
Docmd.runsql(queryZ)
Me.unboundTextBox = “Finished queries”
End sub
‘’’’’’’’’’’’’’’’’’’’’’’’’’’’
The problem is that (on some occasions) the queries will run without
the text being displayed; i.e., the textbox will display “About to run
queries” and then will display “Finished queries.” I thought the
problem was that the queries ran so fast, I just couldn’t see the
textbox change, but this happens even when it takes a few moments for
the queries to finish. E.g., I can see the queries running in the
lower left-hand status bar, but the text will not change.
It’s almost like I need to put in a break (like a msgbox) to get the
textbox to refresh—which works strangely enough? Or possibly to set
the focus back to form/textbox?
Any thoughts?
alex
Hello,
Using Access ’03…
I have quite a bit of VBA code that runs a variety of queries.
Between all of the SQL code, I display information to the user in an
unbound textbox on the form. Something like this:
‘’’’’’’’’’’’’’’’’’’’’’’’’
Sub RunQueries()
Me.unboundTextBox = “About to run queries”
Me.unboundTextBox = “Running Query A”
Docmd.runsql(queryA)
Me.unboundTexBox = “Running Query B”
Docmd.runsql(queryB)
…
Me.unbountTextBox = “Running Query Z”
Docmd.runsql(queryZ)
Me.unboundTextBox = “Finished queries”
End sub
‘’’’’’’’’’’’’’’’’’’’’’’’’’’’
The problem is that (on some occasions) the queries will run without
the text being displayed; i.e., the textbox will display “About to run
queries” and then will display “Finished queries.” I thought the
problem was that the queries ran so fast, I just couldn’t see the
textbox change, but this happens even when it takes a few moments for
the queries to finish. E.g., I can see the queries running in the
lower left-hand status bar, but the text will not change.
It’s almost like I need to put in a break (like a msgbox) to get the
textbox to refresh—which works strangely enough? Or possibly to set
the focus back to form/textbox?
Any thoughts?
alex