Automatically Calculate Field

Dec 16, 2005

Hi guys,

I have a mainform "frm_CaseReference" and a subform "subfrm_CasesControls".

In the main form I have "DOB" field and in the subform I have "DateSlideTaken" and "AgeAtSmear" fields.

I want to automatically calculate age in the "AgeAtSmear" from the "DOB" and "DateSlideTaken" but having problems.

I have tried the following code but it doesnt work:
=DateDiff("yyyy",Forms!frm_CaseReference!DOB-[DateSlideTaken],Now()

I have read it is not good idea to store age but my work place want this so i have to include it. Can someone please help....

View Replies


ADVERTISEMENT

General :: Reoccurring Events - Automatically Calculate Next Service Due Based On Previous Service Date

Aug 5, 2013

I run a service related company and I am trying to develop a service database that will automatically calculate the next service due based on the previous service date, the catch is that the service need to happen on the same week day. i.e. if the last service was on Friday 02-08-2013 and it is a monthly service, the next service is due on Friday 06-09-2013. Is there any way that this can be done? PS there are various service periods such as bi-weekly, weekly, 2 weekly, monthly, 2 monthly etc.

View 2 Replies View Related

Tables :: Calculate Value For A Field Based On Value Of Another Field - Statement

Dec 30, 2012

I'm trying to calculate a value for a field based on the value of another field, [Field1] has a value list of 28 choices I want [Field3] to take that value and multiply it by the value of [Field2]. I'm using an Iif statement and it sort of works. I looks like this:

IIf([Field1]=1 Or 2 Or 3 Or 4 Or 11 Or 12 Or 13 Or 21 Or 22 Or 28,[Field2]*0.06,IIf([Field1]=5 Or 6 Or 14 Or 15 Or 23 Or 24 Or 29,[Field2]*1.1,[Field2]*2.1))

I receive nor errors but it will only return the value of [Field2]*.06 no matter what is selected in [Field1].

I'm sure I'm missing something and there is probably an easier syntax to use, but I'm at a loss at the moment.

View 4 Replies View Related

Automatically Populate A Date Field Based On Value Entered In Another Field

Nov 10, 2005

I need to create a New Form control for this situation:

If I enter a date into a field and the choice for another field is equal to a certain value. How can I get the date I entered to be automatically populated into another date field.

For example:

If I enter 11/10/2005 in a date field and I choose either "BN", "BA", or "BT" in a text field, I need that date of 11/10/2005 to be automatically populated in another date field on the same form.

Any help is greatly appreciated.

View 2 Replies View Related

Tables :: Automatically Fill Field Based On Keywords In Another Field

Dec 3, 2013

I'm trying to complete a database.

It is to manage details of pupils with additional support needs, and plan for the extra arrangements the school will provide for assessments.

It has 2 Tables

tbl-PupilDetails
-ScottishCandidateNumber primary key (Unique number which identifies pupils to the exams board)
-Forename
-Surname
-DOB
-YearGroup
-Class
-NatureOfNeed (memo)
-EvidenceOfNeed (memo)

tbl-SubjectLevelArrangement
-ID Primary key, Autonumber
-Pupil foreign key to tblPupilDetails
-Subject
-Faculty
-Level
-Arrangement

I currently use forms for adding new pupils, and updating pupil subjects/arrangements/levels.

I also have forms to search for specific pupils, and to create lists for faculty heads showing which pupils are taking subjects within their faculty and the arrangements we expect to provide.

I use the forms to run queries, which can then output to reports for printing.

Where I am currently having an issue is the faculty field in the tbl-SubjectLevelArrangements. (If I didn't have to report to faculty heads I would just leave it out, but management will insist.)

Currently I have a form with dropdowns for adding subject, faculty, level and arrangement manually. This is acceptable for the subject, level and arrangement because they are completely interchangeable and dynamic throughout the academic year as pupils may drop down a level, or change the type of arrangement they require.

However as faculties are inextricably linked to subjects, I want to remove the possibility of human error. i.e. when a user (me) chooses either geography, history, or RE, then the faculty will always be Humanities, likewise if the user chooses French, German, or Spanish, then the faculty can only be Modern Languages etc.

I'm convinced there must be a very simple way to ensure that the faculty field prefills based on the limited keywords available in the subject field, but I just cannot figure it out.

View 6 Replies View Related

Reports :: Get Remarks Automatically In Field Based On Other Field In Report

Dec 15, 2013

I made a report that have 'txtRemarks' field, I just want to get remarks automatically in 'txtRemarks' field based on the other field in report. that is why I used a function like below:

Code:
Private Function Estd_Remarks(Estd_Point As Long) As String
If Me.Estd_Point < 20 Or Me.Estd_Point = 0 Then
Estd_Point = "Earlier Established"
Esle
Estd_Point = "OK"
End If
Estd_Remarks = Estd_Point
End Function

And I wrote in properties 'On Format' event this code below:

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Estd_Remarks = "Ok" Then
Me.txtRemarks = "Ranked & Sortlisted"
Else
Me.txtRemarks = "Estd_Remarks"
End If
End Sub

When preview the report then it shows
Compile error
Argument optional

View 3 Replies View Related

Query To Calculate Field Depending On Value Of Another Field?

Oct 13, 2005

hey guys . .

I have 3 fields: TEST, NETQTY, EXTENDED

NETQTY usually = EXTENDED depending on the TEST

BUT the Test PTCGCD has a EXTENDED value that is TWICE the value of NETQTY

How do i create a query which will update the EXTENDED field depending on the TEST value>?

For Example:

The general TESTS: AFP, ANAS, CYC etc . . EXTENDED = NETQTY(1)

PTCGCD: EXTENDED = NETQTY(2)

?

View 1 Replies View Related

Automatically Set A Field Based On A Field In Another Table

Aug 12, 2005

I have two tables, each has a "status" for a project. In the first table there is only one instance of each project name, in the second table there may be more than 1, will always have the same name but may have a different "Status" (field).

I need the Status field of the first table to be set to "Assigned" if ANY of the records in the second table pertaining to that project are set to "Assigned".

Can I do this with my table or will I need to do it with a query/form combination?

Thanks,

View 4 Replies View Related

How To Make A Field Automatically Receive Same Value From Another Field

Apr 22, 2014

In Access 2013, in a table named DOCSDETAIL or form, I want the UTENTE (meaning user) field (Currency type €) automatically receives the same amount of PVP field (Currency type €) but can be modified as needed.

Example: Registration of documents in which the amount paid by the USER has two possibilities;

1. DifferS from PVP (Public Sale Price)
2. Equal the PVP

Looks like it might be used

= "Update your_table set your_field_new = your_field_old"

= "Update DOCSDETALHE set UTENTE = PVP"

But do not know where to put and if the syntax is correct!

View 5 Replies View Related

Calculate Totals In A Field

Dec 6, 2004

I have 4 fields in my table and form (Towing Charges) (Storage Charges) (Other Charges) and (Total Charges). I need to have Towing Charges, Storage Charges & Other Charges to calculate and populate in my Total Charges field. I tried a script in the control source of the field, but its not working. I probably have the script wrong.

Thanks Everbody

View 3 Replies View Related

Auto Calculate Field

Feb 1, 2006

Hi all,

I'm trying to set up a holiday register. In my holiday table i have the following fields HolidayID, PersonID, StartDate, EndDate. I would like to have a final field which auto-calculates the number of days taken between start and end date. I read somewhere this should be done in a query using the DateDiff expression but I can't seem to get this to work.

Any ideas please?

Thanks all!

View 3 Replies View Related

How To Calculate Field In Query

Jun 5, 2007

Hi Friends,

I have made one form based on query. Its a invoice entry form. I have price, quantity and amount. I want when i enter price and quantity, amount should be calculated. I know its very simple for you. Any suggestion.

thanks

mithani

View 2 Replies View Related

Having A Field Calculate Other Fields

Aug 15, 2007

I am trying to get one of my fields to calculate this expression which includes other fields:

If "Financing Type" = 1 or 2 THEN 20% * "Loan Amount" OR
If "Financing Type" = 3 or 4 THEN 100% * "Loan Amount" = 2,000,000.


I thought that this would work, but it only works in queries or reports.

=IIF([FinanceType]<3,[LoanAmount]*.2,[LoanAmount])

I would like this to work in the table.

View 11 Replies View Related

Calculate Field Using Different Field From Different Table?

Jun 2, 2012

i have got this table

Table 1:-- List of available classes

Design view

Class -- Primary key ---text

Subject ----text

Num. Lessons---- Number

Enrolments ---- Number

Max Class Size--- Number

Action -- Calculated because if enrollment is higher then max. class size then its says full otherwise it will tell enrol

Table 2:-- Teacher And Class Income

Class --- text

enrolment --- number

max class size ---- number

income per enrolment ----- currency

incomer per class ----- currency ?

1) but what i wanna do is if i change enrollment and max class size VALUE IN TABLE 1 ... i want that change in table 2 enrollment and max. class size FIELD AS WELL For e.g. if i change enrollment =25 and max class size = 30 ,,, i want that change in table 2 .......so i want that table 2 should display Enrollment = 25, max class size = 30 ,I want this things in TABLES not queries , what should i do... and i compulsory have to use access... NOT EXCEL.

2) then i want that Total Incomer per class (In Table 2) = Enrollment * Income per enrollment so that value should be display on total incomer per class ....So if i change enrollment value ... then the total income per class value has to change ....

3) i want in table that my total income in all class should display in same table ( Table 2)

View 3 Replies View Related

Field To Calculate Time Elapsed

May 15, 2006

I have nearly achieved this from an example on the Microsoft site but am having problems with the subforms. Can anyone take a look and if possible provide me with guidance as to what I am doing wrong. The instructions are included.Any help with this would be very much appreciated. Kind regards. Bernard

View 6 Replies View Related

Calculate Numbers From A Text Field?

Dec 27, 2006

Ok, this one has me stumped.

I have a several fields on my form that are list boxes that must have text as the properties so I can populate the lookup data with things like" Severe rating = 7 points" and "Moderate rating = 3 points". I have another similar field where the choices are "High probability = 9 points" and "Low probability = 2 points" etc. A third field needs to show the total points (product) of the choices from the first two fields, i.e. 9 points x 2 points = 18 points. Then,
a fourth field needs to display where the answer falls in a grid, i.e. 1-14 points = Low, 15-29 points = medium, 30-49 points = high, etc.

How do I apply the calculations on the field choices if the field properties have to be text instead of number?

Thanks,

bugleboy:confused:

View 10 Replies View Related

Calculate Query's Field With Two Result

Sep 28, 2005

Hi All
I try to create a query based on Table1 and fields Date and Result. Is it posible to get a query that calculate two amount of Result field when that field is null and not null?
That two values of Result field I will use to create monthly Pivot report in which each bar will display amonts Completed and NonCompleted result.
Thanks.

View 1 Replies View Related

Query To Calculate Conditional Field

Feb 5, 2007

Dear all,

I have a query that is based on orders table and contains "Qty", 'UnitCost', and "ctualUnitCost", in addition to yes/no control to indicate if "SalesTax" is applicable.

I want an expression in the query to calculate total cost in one of 2 conditions:
if no sales tax then TotalCost = Qty*UnitCost
if sales tax is applicable then Total cost = Qty*UnitCost*1.1

how can I write this expression

thanks

View 2 Replies View Related

Calculate # Of Occurrences Of String In A Field

Jun 25, 2007

Thought I'd be able to find out easily, but.. here I am...

How can I query the number of occurrences of a string in a field, e.g.:

if a name field has the text: Martin Lacoste

how can I get it to tell me there are two "a"s in the field?

I can use InStr to find one, and make a few more queries to find a few subsequent, but the data I need to search could have 30-40 occurrences of the desired text in a field.

Ideas?
Thanks!
Martin Lacoste

View 6 Replies View Related

How To Calculate The Accumulate Value Of The Current Field

Jan 21, 2005

If I have the field name as below:

Oil quantity
Accumulate Oil quantity
Date
Recordnumber


I want to get value of "Accumulate oil quantity" of current record to be equal to sum of "Oil quantity" from first record till the current record:

Let say
after I input "oil quantity" in the record # 1 ,2 & 3
The "Accumulate oil quantity" of record value show below:

"Accumulate oil quantity" of record#1 = "Oil quantity" of record#1
"Accumulate oil quantity" of record#2 = "Oil quantity" of record#1 + "Oil quantity" of record#2
"Accumulate oil quantity" of record#3 = "Oil quantity" of record#1 + "Oil quantity" of record#2+"Oil quantity" of record#3

Anyone know , please help
Thank you so much

View 1 Replies View Related

Calculate Text Box And Insert To Field

May 15, 2012

i have 1 table name "table1"and i have in this table 4 fields

1) id
2)pay
3) tax
4) total

The id is primary. I have form in this form i have 3 text box "pay" "tax" "total". i want to insert some number to pay and number to tax and make some button to make calculation of the 2 text box and it will show me the result in the total and insert them to the fields.

View 3 Replies View Related

Calculate Numerical Data In A Text Field

Nov 29, 2004

is there any way I can make a field with a data type that calculates numbers in the field but also allows text to be entered into the field (e.g. N/A or No Score) The non-numerical data certainly wouldn't have to be calculated and could be filtered out when calculating averages and other numerical operations.

Thanks

View 2 Replies View Related

Queries :: Calculate Multiple Values Same Field

Feb 22, 2014

I have a table where there are multiple vehicles, each identified by their vehiclenumber. Each record holds the vehiclenumber, date and odometer reading. I need to figure out how to calculate records in this table per each vehiclenumber.

Below is a code that works, but only when i have each vehicle with the same vehiclenumber.

SELECT tblOdometer.VehicleNum, tblOdometer.ODate, tblOdometer.Odometer, tblOdometer.Odometer AS OdomAlias,
Nz(DLast("Odometer","tblOdometer","[Odometer] < " & [OdomAlias]),0) AS Previous, [Odometer]-[Previous] AS Difference
FROM tblOdometer;

View 4 Replies View Related

Field In A Database That Calculate Age Of A Person Based On DOB?

Jun 23, 2014

I need to have a field in a database that will calculate the age of a person, based on their DOB. I have it in the excel sheet that I imported into Access to create the data base, but it just copied the number that was already there. When I add new entries into the database, the age isn't calculated. How do I do this?

The forumla I use in my spreadsheet is: =DATEDIF(O2,TODAY(),"y")

View 1 Replies View Related

How To Create A Field To Calculate Value Which Obtain Value From Different Table

Jan 1, 2013

I'm trying to summarize the value from multiple fields in a table and the total value will be updated on a different table as per highlighted below (taken from Northwind Web Database).

View 3 Replies View Related

How To Calculate Number Of First Letters Of Names In A Field

Sep 9, 2011

how to write out the query Im trying to create so I'll create an example:

Field: Drivers Names
I want to know how to create a query that will calculate the # of drivers names which starts with, A, B, C etc.
I want my query to be:

Drivers names first letter # of first letters
A 10
B 19
C 15

how I can create such a query

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved