Solved

variance in access filter

Posted on 2016-11-02
3
22 Views
Last Modified: 2016-11-02
I am in vba and I am trying to get access to filter 5 either side of the cc so if subform value is 2400 the filter will allow 2395 to 2405

I thought this would do it

Me.QryNonSMMTData_subform.Form.Filter = "CC= >=Me.CC.Value - 5 and <= Me.CC.Value + 5"
0
Comment
Question by:PeterBaileyUk
3 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 41870068
Hi,

pls try

Me.QryNonSMMTData_subform.Form.Filter = "CC >=Me.CC.Value - 5 and CC <=Me.CC.Value + 5" 

Open in new window

Regards
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 41870079
is the reference to Me.CC.Value an unbound control on the form or is it the value of the [CC] field in the currently selected record?

You might try:

me.qryNonSMMTData_subform.Form.Filter = "([CC] >= " & (me.CC - 5) & ") AND ([CC] <= " & (me.CC + 5) & ")"
me.qryNonSMMTData_subform.Form.FilterOn = true
0
 

Author Closing Comment

by:PeterBaileyUk
ID: 41870153
thank you
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

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

18 Experts available now in Live!

Get 1:1 Help Now