Solved

variance in access filter

Posted on 2016-11-02
3
42 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
[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 51

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

Technology Partners: 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…
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

751 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