filter not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • favor08
    New Member
    • Jan 2007
    • 56

    filter not working

    Code:
    Dim linkerDim linker 
    Dim strSQL As String 
    linker = StobMainFrame.Value 
    Select Case linker 
    
    strSQL = "TStobDaily.Category In('61','73') AND TStobDaily.DateIn 
    
    
    
    >#5/31/2007# AND PendDte Is Null AND Tstobdaily.LogInID=fOSUserName()" 
    
    
    End select 
    End Sub
    The "DateIn" is still bring back dates less than 5/31/2007. Any
    suggestions?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Originally posted by favor08
    Code:
    Dim linkerDim linker 
    Dim strSQL As String 
    linker = StobMainFrame.Value 
    Select Case linker 
    
    strSQL = "TStobDaily.Category In('61','73') AND TStobDaily.DateIn 
    
    
    
    >#5/31/2007# AND PendDte Is Null AND Tstobdaily.LogInID=fOSUserName()" 
    
    
    End select 
    End Sub
    The "DateIn" is still bring back dates less than 5/31/2007. Any
    suggestions?
    First off, if this is just a section of code then you need to let us know that.

    If not, then this code can't possibly work.
    The strSQL is seperated over two lines without the continue to next line character.

    You have a SELECT CASE without any CASE clauses.

    strSQL by itself does not do anything. It only gets assigned a value but nothing is done with it.

    Comment

    • favor08
      New Member
      • Jan 2007
      • 56

      #3
      Originally posted by Rabbit
      First off, if this is just a section of code then you need to let us know that.

      If not, then this code can't possibly work.
      The strSQL is seperated over two lines without the continue to next line character.

      You have a SELECT CASE without any CASE clauses.

      strSQL by itself does not do anything. It only gets assigned a value but nothing is done with it.
      Here is the complete Code for this piece:

      Code:
      Private Sub StobMainFrame_AfterUpdate()
      On Error GoTo StobMainFrame_Err
      Dim linker
      Dim strSQL As String
      linker = StobMainFrame.Value
      Select Case linker
      Case 5
      ittype = 5
      'dayone QUEUE
              Me.Cmdclose.SetFocus
              Me.FStobDaily.Form.FilterOn = False
              strSQL = "TStobDaily.PendDte Is Null AND TStobDaily.Category In('61','73') AND TStobDaily.DateIn>#5/31/2007# AND Tstobdaily.LogInID=fOSUserName()"
              FStobDaily.Visible = True
              Me.FStobDaily.Form.Filter = strSQL
              Me.FStobDaily.Form.FilterOn = True
              Me.Box2.Visible = True
              Me.BxClr.Visible = True
              Me.cboOpid2.Visible = True
              Me.lblopid2.Visible = True
              Me.CmdStobClear.Visible = True
              Me.txtPolicy2.Visible = False
              Me.lblpolicy2.Visible = False
              Me.cboOpid2 = DLookup("[Opid]", "Tstobdaily", "[LoginID] = FOSUserName()")
              istobopid = Me.cboOpid2
              If ittype = 5 And NZ(Me.cboOpid2) <> "" Then
              Me.CboProd2.Visible = True
              Me.lblprod2.Visible = True
              Me.CboProd2.RowSource = "qDay1StobProdCd"
              Me.CboProd2 = ""
              Me.CboProd2.Requery
              End If
      End Select

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Does it filter anything at all?
        Are you trying to filter a subform?
        Have you tried to compile the code?

        Comment

        • favor08
          New Member
          • Jan 2007
          • 56

          #5
          it filters a subform.

          and it was working fine until I added the dateIn code.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            Check the data type of the DateIn and see if it's date/time.

            Comment

            Working...