By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,444 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

filter not working

P: 56
Expand|Select|Wrap|Line Numbers
  1. Dim linkerDim linker 
  2. Dim strSQL As String 
  3. linker = StobMainFrame.Value 
  4. Select Case linker 
  5.  
  6. strSQL = "TStobDaily.Category In('61','73') AND TStobDaily.DateIn 
  7.  
  8.  
  9.  
  10. >#5/31/2007# AND PendDte Is Null AND Tstobdaily.LogInID=fOSUserName()" 
  11.  
  12.  
  13. End select 
  14. End Sub   
The "DateIn" is still bring back dates less than 5/31/2007. Any
suggestions?
Jun 5 '07 #1
Share this Question
Share on Google+
5 Replies


Rabbit
Expert Mod 10K+
P: 12,324
Expand|Select|Wrap|Line Numbers
  1. Dim linkerDim linker 
  2. Dim strSQL As String 
  3. linker = StobMainFrame.Value 
  4. Select Case linker 
  5.  
  6. strSQL = "TStobDaily.Category In('61','73') AND TStobDaily.DateIn 
  7.  
  8.  
  9.  
  10. >#5/31/2007# AND PendDte Is Null AND Tstobdaily.LogInID=fOSUserName()" 
  11.  
  12.  
  13. End select 
  14. 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.
Jun 5 '07 #2

P: 56
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:

Expand|Select|Wrap|Line Numbers
  1. Private Sub StobMainFrame_AfterUpdate()
  2. On Error GoTo StobMainFrame_Err
  3. Dim linker
  4. Dim strSQL As String
  5. linker = StobMainFrame.Value
  6. Select Case linker
  7. Case 5
  8. ittype = 5
  9. 'dayone QUEUE
  10.         Me.Cmdclose.SetFocus
  11.         Me.FStobDaily.Form.FilterOn = False
  12.         strSQL = "TStobDaily.PendDte Is Null AND TStobDaily.Category In('61','73') AND TStobDaily.DateIn>#5/31/2007# AND Tstobdaily.LogInID=fOSUserName()"
  13.         FStobDaily.Visible = True
  14.         Me.FStobDaily.Form.Filter = strSQL
  15.         Me.FStobDaily.Form.FilterOn = True
  16.         Me.Box2.Visible = True
  17.         Me.BxClr.Visible = True
  18.         Me.cboOpid2.Visible = True
  19.         Me.lblopid2.Visible = True
  20.         Me.CmdStobClear.Visible = True
  21.         Me.txtPolicy2.Visible = False
  22.         Me.lblpolicy2.Visible = False
  23.         Me.cboOpid2 = DLookup("[Opid]", "Tstobdaily", "[LoginID] = FOSUserName()")
  24.         istobopid = Me.cboOpid2
  25.         If ittype = 5 And NZ(Me.cboOpid2) <> "" Then
  26.         Me.CboProd2.Visible = True
  27.         Me.lblprod2.Visible = True
  28.         Me.CboProd2.RowSource = "qDay1StobProdCd"
  29.         Me.CboProd2 = ""
  30.         Me.CboProd2.Requery
  31.         End If
  32. End Select
  33.  
Jun 5 '07 #3

Rabbit
Expert Mod 10K+
P: 12,324
Does it filter anything at all?
Are you trying to filter a subform?
Have you tried to compile the code?
Jun 5 '07 #4

P: 56
it filters a subform.

and it was working fine until I added the dateIn code.
Jun 5 '07 #5

Rabbit
Expert Mod 10K+
P: 12,324
Check the data type of the DateIn and see if it's date/time.
Jun 5 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.