Solved

mismatch on datatype in filter

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

752 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