Solved

variance in access filter

Posted on 2016-11-02
3
16 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 48

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

744 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

11 Experts available now in Live!

Get 1:1 Help Now