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, "*") & "'"
chrisamuelAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peter57rCommented:
Hello chrisamuel,

You are speciftying the date difference must be Greater Than the combo value.
If you want to allow the combo value as well you should use >=


Pete.
0
Alan WarrenApplications DeveloperCommented:
Hi sean,

try using Val(Forms!frmPhaseData2.cboDays)

outputs:

 And [B2B EDGE].phase = 0 And DateDiff('d', app_date, Now) < 500 And DateDiff('d', app_date, Now) > 8 And [B2B EDGE].Manager like 'fred'


Alan
0
Alan WarrenApplications DeveloperCommented:
should return all records with app_date between 9 and 499 days old with phase = 0 and manger like 'Fred'
0
cws05Commented:
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
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chrisamuelAuthor Commented:
Thanks! I'm glad it was a simple fix.

- Christine
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.