If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
form keeps calculating
I have the following code behind several after update events as well as form
current: Function StoreCtls() Dim blTorF As Boolean Dim nBrand As Integer Dim qdf As DAO.QueryDef Dim strSQL As String Dim strSelect As String Dim strAnd As String Dim strGroupBy As String Dim strOrderBy As String Dim rsATLOS As DAO.Recordset Dim blATLOS As Boolean Dim strPrftPct As String Set qdf = dbLocal.QueryDefs("qryMktsCombo") strSelect = "SELECT qryStoreMaster.[Market#], [Market Name], MktNm" & vbCrLf strSelect = strSelect & "FROM qryStoreMaster" & vbCrLf strSelect = strSelect & "WHERE Not qryStoreMaster.[Market#] Is Null" strAnd = " AND Brand=" strGroupBy = vbCrLf & "GROUP BY qryStoreMaster.[Market#], [Market Name], MktNm" & vbCrLf strOrderBy = "ORDER BY qryStoreMaster.[Market#]" With Me blTorF = (Nz(.grpBrands, 0) = 0 And Nz(.grpPrftsOvrUnd, 0) = 0 And Nz(. grpSlsOvrUnd, 0) = 0 _ And Nz(.cmbMarket, 0) = 0) And Nz(.grpProfit_, 0) = 0 .cmbStores.Visible = blTorF .txtStoreBrand.Visible = blTorF .txtStoreCityST.Visible = blTorF .txtStoreDesc.Visible = blTorF nBrand = .grpBrands End With Select Case nBrand Case 0 strAnd = "" Case 1 strAnd = strAnd & """ATS""" Case 2 strAnd = strAnd & """ATF""" Case 3 strAnd = strAnd & """ATL""" Case 4 strAnd = strAnd & """ATLOS""" End Select With Me .txtOver = 0 .txtUnder = 0 Select Case .grpProfit_ Case 0 .txtOver.Visible = False .txtUnder.Visible = False Case 1 .txtOver.Visible = True .txtUnder.Visible = False Case 2 .txtOver.Visible = False .txtUnder.Visible = True Case 3 .txtOver.Visible = True .txtUnder.Visible = True End Select End With qdf.SQL = strSelect & strAnd & strGroupBy & strOrderBy 'strSQL = "SELECT Brand FROM qryStoreMaster WHERE Not [Market#] Is Null AND Sales""0"" AND Profits""0"" AND Brand=""ATLOS""" strSQL = "SELECT BrandCode" & vbCrLf strSQL = strSQL & "FROM (tblBrands INNER JOIN tblStoreMaster ON tblBrands. BRANDID = tblStoreMaster.brandid)" strSQL = strSQL & " INNER JOIN qryLTMSales ON tblStoreMaster.[Store #] = qryLTMSales.[Store #]" & vbCrLf strSQL = strSQL & "WHERE BrandCode=""ATLOS"" AND Not [Market#] Is Null AND LTMSls0" Set rsATLOS = dbLocal.OpenRecordset(strSQL) blATLOS = Not rsATLOS.EOF With Me With .cmbMarket .RowSource = .RowSource .Requery End With .optATLOS.Enabled = blATLOS End With rsATLOS.Close Set rsATLOS = Nothing End Function Can anyone tell me why the form keeps recalculating? What workaround would you suggest? Thanks, Bill -- Bill Reed "If you can't laugh at yourself, laugh at somebody else" Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200808/1 |
Thread Tools | |
Display Modes | |
|
|