Solved

mismatch on datatype in filter

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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 …

743 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

14 Experts available now in Live!

Get 1:1 Help Now