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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Status

Status
Not open for further replies.

mrliam69

Programmer
Jul 21, 2003
75
GB
On my access Forms I have little list boxes that display various information about the data each has a refresh button that updates the rowsource but a couple of them take about 25 seconds to execute and I was trying to get the label to change colour to show it is doing something and revert back again when it is done, but I'm finding that they change colour in millisecinds and the sql statement is running in the background still....

===========================================================
Code:
 Private Sub RefreshOutOfStocksButton_Click()
  Me.OutofStocksLabel.BackColor = 65280
    Select Case Len(Me.OutOfStocks.RowSource)
        Case 0
            Let Me.OutOfStocks.RowSource = "SELECT TOP 100 PERCENT STK_STOCK_2.STK_SANALYSIS10 AS Analysis, STK_LOCATION.LOC_STOCK_CODE AS Stock_Code, STK_STOCK3.STK_USRNUM1 AS ADS, STK_STOCK3.STK_NUM1 AS TREND, VIEW_Sales_Last30Days.Qty AS Last30 FROM SL_ANALYSIS INNER JOIN STK_STOCK_2 ON SL_ANALYSIS.SACODE = STK_STOCK_2.STK_SANALYSIS10 INNER Join STK_LOCATION ON STK_STOCK_2.STKCODE2 = STK_LOCATION.LOC_STOCK_CODE INNER Join STK_STOCK3 ON STK_STOCK_2.STKCODE2 = STK_STOCK3.STKCODE3 LEFT OUTER Join VIEW_Sales_Last30Days ON STK_STOCK_2.STKCODE2 = VIEW_Sales_Last30Days.SM_STOCK_CODE WHERE (STK_LOCATION.LOC_PHYSICAL = 0) AND (STK_STOCK_2.STK_SANALYSIS10 IN ('10115', '10112')) AND (STK_LOCATION.LOC_CODE = 'free') ORDER BY STK_STOCK_2.STK_SANALYSIS10, STK_LOCATION.LOC_STOCK_CODE"
        Case Else
            Let Me.OutOfStocks.BoundColumn = Me.OutOfStocks.BoundColumn
    End Select
Me.OutofStocksLabel.BackColor = 10079487
End Sub
 
yeah, if you set the rowsource, then once the rowsource is set, the execution of the code continues independant of wether the row has updated or not...

as a simple solution, try putting a me.outofstocks.requery behind the set rowsource

if that doesn't work, use recordsets. i.e. open a recordset, set the recordset of the control...

--------------------
Procrastinate Now!
 
What I need is sonething that interupts it in some way....

I put a msgbox just after the change color commands and it works its just that you have to press ok twice on the msgbox

is there anything else I can use to cause that interupt ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top