Caption not updating

pop79

New member
Local time
Tomorrow, 06:06
Joined
May 29, 2008
Messages
2
I have a main form that has a label that displays a status message to show the status of what the database is doing (like connecting to ODBC tables).

I'm having a problem where I have some code that runs to relink ODBC tables using a DSN-less connection, but before doing this I would like the status label to display a message like "Connecting to data sources..." but unfortunately it appears that Access does not execute code in sequential order. The label does not change, but the connection routine runs, and after the connections have been updated then the label is changed. Is there anyway to make a label act in the way I want it to?

Code:
    Case "CONNECT"
      UpdateConnectionStatus
      ConnectToData
      UpdateConnectionStatus
 
Try putting in a DoEvents first to give other Access tasks some cpu time.
 
Thanks heaps, it works great :)

Edit: but could my code have any flaws? Like waiting forever?

Code:
Case "CONNECT"
      ODBCStatus = 3
      UpdateConnectionStatus
      While DoEvents > 0
      Wend
      ConnectToData
      UpdateConnectionStatus
 
Pop79,

this would work as well:
Code:
Case "CONNECT"
      ODBCStatus = 3
      UpdateConnectionStatus
      DoEvents
      ConnectToData
      UpdateConnectionStatus

HTH,
Chris
 

Users who are viewing this thread

Back
Top Bottom