G
Guest
Any help is greatly appriciated. This is my situation. I have a form with 8
price breaks,Qty1 thru Qty8. I have created a combo box[Combo111] as a field
list for the query i am using. I have also created 2 unbound text boxes to
search the from price[fromQty] and the to price[toQty]. The code in the on
click of my button is as follows:
Private Sub Command74_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.fromQty) Then
strWhere = strWhere & "([Combo111] >= " & Format(Me.fromQty) & ") And"
End If
If Not IsNull(Me.toQty) Then
strWhere = strWhere & "([Combo111] <= " & Format(Me.toQty) & ") And"
End If
lngLen = Len(strWhere) - 4
If lngLen <= 0 Then
MsgBox " No criteria", vbInformation, "Nothing to do."
Forms!CopyOfQuoteBook!fromQty1.SetFocus
Else
strWhere = Left$(strWhere, lngLen)
'Debug.Print strWhere
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
My goal is to find everything in the query by price break between the
specified dollar amounts. I know im missing something but im pretty new to
access. Again any help is greatly appriciated, Thanks.
price breaks,Qty1 thru Qty8. I have created a combo box[Combo111] as a field
list for the query i am using. I have also created 2 unbound text boxes to
search the from price[fromQty] and the to price[toQty]. The code in the on
click of my button is as follows:
Private Sub Command74_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.fromQty) Then
strWhere = strWhere & "([Combo111] >= " & Format(Me.fromQty) & ") And"
End If
If Not IsNull(Me.toQty) Then
strWhere = strWhere & "([Combo111] <= " & Format(Me.toQty) & ") And"
End If
lngLen = Len(strWhere) - 4
If lngLen <= 0 Then
MsgBox " No criteria", vbInformation, "Nothing to do."
Forms!CopyOfQuoteBook!fromQty1.SetFocus
Else
strWhere = Left$(strWhere, lngLen)
'Debug.Print strWhere
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
My goal is to find everything in the query by price break between the
specified dollar amounts. I know im missing something but im pretty new to
access. Again any help is greatly appriciated, Thanks.