473,416 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

filter by form on a calculated control

6
hi all.

I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields [date-of-birth] and [date-of-surgery]).

However, when I click "Filter by Form" in order to search for records based on this form, I would like to be able to enter a value in this "days" control so that I can filter records on the form based on this calculated interval (i.e., i want to search for records specifically where the # of days between date-of-birth and date-of-surgery is =5, or is <365, etc.). However, when i click "filter-by-form", the calculated control grays-out and does not permit entry of critera on which to filter.

Now, i can do this manually by designing a specific query where I enter the DateDiff command as an expression and by providing the desired criteria for the expression. However, I am trying to set the database up for "ease-of-use" with others, and would prefer not to require any users to make custom-queries. The only way I've found around this thus far is to actually create a new field in my Table called [date-interval], export my [date-of-birth] and [date-of-surgery] fields to Excel, calculate the date interval in Excel, and paste those values into the new [date-interval] field in my Access table; I can then place a control linked to the [date-interval] field in my form, and when I filter by form, I can achieve the desired effect of filtering by the [date-interval]. I am fine with having this added field in my table, but (1) I don't know how to make it a "calculated field" such that whenever a new record is added, the [date-interval] field is automatically populated with the proper value based on [date-of-birth] and [date-of-surgery]; and (2) access experts seem to recommend against having calculated fields in tables (again, I wouldn't mind doing it, but I don't know how to in this case).

So, to summarize, I am looking for a way to have a calculated control on a Form, that I could manually enter a filter criteria into when I toggle on the Filter-by-Form command, and if this is not possible, then I need a way to have a calculated field in my table that automatically fills itself in based on data from 2 other fields in that same table (and therefore I could filter-by-form based on this "calculated field").

sorry for the long post, but I want to be as descriptive as possible.
thanks in advance,
Jason
Jan 23 '07 #1
2 5484
nico5038
3,080 Expert 2GB
Why not put the calculation in the form's query ?

Nic;o)
Jan 23 '07 #2
NeoPa
32,556 Expert Mod 16PB
I surmise, from your description, that the Filter By option only works on the underlying recordset. It can't use fields simply displayed on the form (This makes sense if you think about it). Nico's solution is therefore the perfect solution for this situation :)
Jan 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sanders | last post by:
I inherited an Access database and I have not worked with Access for very long. I have a Form that goes through a bunch of different queries until it spits out a datasheet with all kinds of...
7
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals....
2
by: B Love | last post by:
Hello Group, I have 2 text fields that I would like to concatenate for use in a table. One field is an ordinary text box. The other is a simple combo box which I use to select one of about ten...
2
by: Seth Delaney | last post by:
I have a form with multiple unbound text boxes which serves as a "search form". I can enter my search parameters in the various boxes as needed and click okay. My records are then filtered to...
9
by: Tony Williams | last post by:
I have two tables 1.tblmonth which holds two fields txtmonth and txtqtrlabel and 2. tblmain which holds a number of fields but in particular a field called txtqtrlabel2. The two tables are linked...
2
by: Tony Williams | last post by:
I have a form with a tabcontrol which has a number of pages. I want to check the value of a calculated control on one page with a calculated control on another page. The calculated control...
7
by: Keith | last post by:
A2003, XP Pro SP2. I'm developing a simple custom filter form for a client and keep running into the same error. I've posted a simplified version in my web space at ...
6
by: dhowell | last post by:
I have a "form" and "subform" where I would like a calculated control on the form which sums the values of a datasheet column of the subform. (datasheet on subform may have a variable number of...
13
by: terrybens | last post by:
Hello, I'm using a Microsft Access 2000 Project (adp file) connected to MS SQL Server 2000 database. I have created a continous form having a detail part (results of the query) and a footer...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.