Question : CInt not working

I can't seem to get this to evaluate the number in the combo box as a number.  The immediate window shows the number in the combo box as '8' and is only bringing up records that are 9 days old.  The other records 10 Days and older are not showing up.

s = s & " And [B2B EDGE].phase = 0" & _
    " And DateDiff('d', app_date, Now) < 500" & _
    " And DateDiff('d', app_date, Now) > '" & CInt(Forms!frmPhaseData2.cboDays) & "'" & _
    " And [B2B EDGE].Manager like '" & Nz(Me.cboManager, "*") & "'"

Answer : CInt not working

enclosing stuff in single quotes make access evaluate as text. Make sense?

Replace your code with this

s = s & " And [B2B EDGE].phase = 0" & _
    " And DateDiff('d', app_date, Now) < 500" & _
    " And DateDiff('d', app_date, Now) > " & CInt(Forms!frmPhaseData2.cboDays) &  _
    " And [B2B EDGE].Manager like '" & Nz(Me.cboManager, "*") & "'"

Chris
Random Solutions  
 
programming4us programming4us