Problems with Strwhere

sspreyer

Registered User.
Local time
Today, 04:06
Joined
Nov 18, 2013
Messages
251
hi , all

i have check box called invoice. if the user makes invoice check true then i would like to show all the blank records with invoice date field is null

Code:
 If Me.[invoice] = True Then
      If strWhere <> vbNullString Then
            strWhere = strWhere & " AND "
            End If
         strWhere = strWhere & "[Invoice Date] is Null"
 End If

this works but blocks any of my other filters

i have start and end date text boxes where the use inputs the a date range for works completed then be able to make the invoice check box true and only show the record in that date range of date work completed but know invoice date.

sorry if im not that clear

Code:
 strDateField = "[Date Work Completed]"

If IsDate(Me.txtStartDate) Then
        strWhere = "(" & strDateField & " >= " & Format(Me.txtStartDate, strcJetDate) & ")"
    End If
    If IsDate(Me.txtEndDate) Then
        If strWhere <> vbNullString Then
            strWhere = strWhere & " AND "
        End If
        strWhere = strWhere & "(" & strDateField & " < " & Format(Me.txtEndDate + 1, strcJetDate) & ")"
    End If

thanks in advance

shane
 
What's the whole code? You can use this to see how the variable is ending up:

http://www.baldyweb.com/ImmediateWindow.htm


Sorry for the late reply

Thanks Pbaldy debug.print cleared the matter up. It was obvious once checking in the Immediate window it was written correctly in the first place :banghead: there wasn't anything matching the criteria because i was searching the wrong date field should of been completed date Not payment date field.:banghead::D

also sort now thanks

;)
Shane
 

Users who are viewing this thread

Back
Top Bottom