T
ThriftyFinanceGirl
I had this code working yesterday, now I get this runtime error 2001 "You
cancelled the previous operation."
Pops up when it hits the SQL, but it was working yesterday. Grrrrr! Any
help?
--------------------------------
Private Sub psBuildSQL()
Dim strWhere As String
strWhere = "WHERE ([State] = """ & Me.cmbFilterState & """) "
If Len(Nz(Me.cmbCounty, "")) <> 0 Then
strWhere = strWhere & " AND ([County] = """ & Me.cmbCounty & """)"
End If
If Len(Nz(Me.cmbCity, "")) <> 0 Then
strWhere = strWhere & " AND ([City] = """ & Me.cmbCity & """)"
End If
If Len(Nz(Me.cmbTaxType, "")) <> 0 Then
strWhere = strWhere & " AND ([TaxTypeID] = """ & Me.cmbTaxType & """)"
End If
Me.qryWorkWithTax_subform.Form.RecordSource = _
"SELECT Location.BusUnit, Location.Description, Location.APOCode, "
& _
"TaxRatesBases.TaxName, TaxRatesBases.TaxPercentage,
TaxRatesBases.TaxEffectiveDate, " & _
"TaxRatesBases.TaxEndDate, TaxRatesBases.TaxCollPeriod,
TaxRatesBases.TaxPeriodQEnds, " & _
"Location.State, Location.City, Location.County, TaxTypes.TaxType,
TaxTypes.TaxTypeID " & _
"FROM TaxTypes INNER JOIN (Location INNER JOIN TaxRatesBases ON
Location.BusUnit = TaxRatesBases.BusUnit) ON TaxTypes.TaxTypeID =
TaxRatesBases.TaxName " & _
"" & strWhere & " ORDER BY Location.BusUnit;"
Me.qryWorkWithTax_subform.Form.Requery
cancelled the previous operation."
Pops up when it hits the SQL, but it was working yesterday. Grrrrr! Any
help?
--------------------------------
Private Sub psBuildSQL()
Dim strWhere As String
strWhere = "WHERE ([State] = """ & Me.cmbFilterState & """) "
If Len(Nz(Me.cmbCounty, "")) <> 0 Then
strWhere = strWhere & " AND ([County] = """ & Me.cmbCounty & """)"
End If
If Len(Nz(Me.cmbCity, "")) <> 0 Then
strWhere = strWhere & " AND ([City] = """ & Me.cmbCity & """)"
End If
If Len(Nz(Me.cmbTaxType, "")) <> 0 Then
strWhere = strWhere & " AND ([TaxTypeID] = """ & Me.cmbTaxType & """)"
End If
Me.qryWorkWithTax_subform.Form.RecordSource = _
"SELECT Location.BusUnit, Location.Description, Location.APOCode, "
& _
"TaxRatesBases.TaxName, TaxRatesBases.TaxPercentage,
TaxRatesBases.TaxEffectiveDate, " & _
"TaxRatesBases.TaxEndDate, TaxRatesBases.TaxCollPeriod,
TaxRatesBases.TaxPeriodQEnds, " & _
"Location.State, Location.City, Location.County, TaxTypes.TaxType,
TaxTypes.TaxTypeID " & _
"FROM TaxTypes INNER JOIN (Location INNER JOIN TaxRatesBases ON
Location.BusUnit = TaxRatesBases.BusUnit) ON TaxTypes.TaxTypeID =
TaxRatesBases.TaxName " & _
"" & strWhere & " ORDER BY Location.BusUnit;"
Me.qryWorkWithTax_subform.Form.Requery