Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mismatch on datatype in filter

Posted on 2013-01-10
3
Medium Priority
?
340 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Expert Comment

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

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

721 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