Solved

mismatch on datatype in filter

Posted on 2013-01-10
3
309 Views
Last Modified: 2013-01-10
I have a filter unfortunately the field [doors extracted] is a string field. How can I amend the code so the filter will work? I tried cint but that didnt work.
If Not IsNull(Me.CBExportDoors) Then
    Counter = Counter + 1
    Select Case Counter
        Case Is = 0
        Case Is = 1

'
                    strFilter = "(cint([DoorsExtracted]) >= " & Me.CBExportDoors.Value - VDoorsExportCount & " AND cint([DoorsExtracted]) <= " & Me.CBExportDoors.Value + VDoorsExportCount & " Or isnull([DoorsExtracted]))"


        Case Is > 1

'
                    strFilter = strFilter & " and " & "([DoorsExtracted] >= " & Me.CBExportDoors.Value - VDoorsExportCount & " AND [DoorsExtracted] <= " & Me.CBExportDoors.Value + VDoorsExportCount & " Or isnull([DoorsExtracted]))"
    End Select

End If

Open in new window

0
Comment
Question by:PeterBaileyUk
3 Comments
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38766078
How about:
 Value([DoorsExtracted])
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 38766089
try


 strFilter = "[DoorsExtracted] >= '" & Cstr(Me.CBExportDoors.Value - VDoorsExportCount) & "' AND [DoorsExtracted] <= '" & cstr(Me.CBExportDoors.Value + VDoorsExportCount) & "' Or [DoorsExtracted] Is null"
0
 

Author Closing Comment

by:PeterBaileyUk
ID: 38766120
Thank you and HNY
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question