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
2 5540 nico5038 3,080
Recognized Expert Specialist
Why not put the calculation in the form's query ?
Nic;o)
NeoPa 32,569
Recognized Expert Moderator MVP
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 :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 information
from different tables, calculated fields etc. I need to filter the
data by workers projects and then sort the remainding data. I am not
sure if I can do this in the query to the data sheet or if I have to
update the form. I think the...
|
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. I can do this the
first time the form loads.
|
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 items.
The ordinary text field is: NewLongDescription
(This is a memo field that contains descriptions of dolls sold in an e-comm
site)
|
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 produce the
results I want in a separate form (filter by form). No problem, except
I want to save the sql to a query, not a form.
When I debug.print the various sql, I get something like this example:
(( LIKE "cam*"))
which obviously is not enough...
|
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 on txtqtrlabel and
txtqtrlabel2. I have a main form based on tblmonth which has a subform based
on tblmain, the two forms are also linked on the same fields.
The data entered into txtmonth could be "30/09/04" and the txtqtrlabel data
would be...
| |
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 (txtTotNbrClients) on page 3 is the sum
of these controls on that page
( + + +
+ + +
+ )
The calculated control on page 4 (txtClientsTot) is the sum of these
controls on that page
( + + + +
|
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
http://keith.wilby.users.btopenworld.com/dbase/db4.zip
Try this:
Open frmTest, then open fdlgFilter.
|
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 entries)
I can't seem to get the calculated control on main form to do what I
want......
Is this possible, if so, how?
Help!
|
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 part (aggregate functions).
My problem concerns the sub-totals calculated in the footer part that are not updated when the results are filtered in the form.
For exemple, if we have the following results
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |