Solved

mismatch on datatype in filter

Posted on 2013-01-10
3
301 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 119

Accepted Solution

by:
Rey Obrero 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now