Expression

T

Terry

My first table with expressions worked after I messed with the relationship
of the tables I had such a mess that I started over. Now the expressions
aren't working.
Pro Rate Table
Auto Num
Unit
MonthlyRent
DailyRent [MonthlyRent]/30
StartDate
EndDate
NumDays [EndDate]-[StartDate]
Amt [MumDays]*[DailyRent]

Originally I had Monthlyrent getting data from another field =adj rent .....
StartDate got data =LeaseStart+30
all the data is in the same table and the same form
any ideas...
 
X

XPS35

=?Utf-8?B?VGVycnk=?= said:
My first table with expressions worked after I messed with the relationship
of the tables I had such a mess that I started over. Now the expressions
aren't working.
Pro Rate Table
Auto Num
Unit
MonthlyRent
DailyRent [MonthlyRent]/30
StartDate
EndDate
NumDays [EndDate]-[StartDate]
Amt [MumDays]*[DailyRent]

Originally I had Monthlyrent getting data from another field =adj rent .....
StartDate got data =LeaseStart+30
all the data is in the same table and the same form
any ideas...

My idea is to remove DailyRent, NumDays and Amt from the table. There is
no need to store those values since you can calculate them whenever
needed.
On your form you can add unbound fields with expressions like you
mention ([MonthlyRent]/30).
 
A

Arvin Meyer [MVP]

There is nothing intrinsically wrong with the expressions themselves.
Expressions only work in Access 2010 tables. The use of expressions in
tables is against all normalization rules and is highly undesirable. The
capacity is built in to use with Sharepoint, and has no value outside of
that application. So if you are not using Sharepoint, get rid of those
fields. If you are not using Access 2010, it won't work in a table. Build
queries with the expressions and you will be fine.
 
W

Wayne-I-M

On your form you can add unbound fields with expressions like you
mention ([MonthlyRent]/30).


The daily rent would be
monthly * 12 / divided by the number of day in the year, bearing in mind
that leap years have an extra day and, as leap years are divisable by 4 you
could use something like this
This assumes you want the current year ?

IIf(Int((DatePart("yyyy",Date()])/4))=(DatePart("yyyy",Date())/4),(([MonthlyRent]*12)/366),(([MonthlyRent]*12)/365))

Just a thought

:)


--
Wayne
Manchester, England.



XPS35 said:
=?Utf-8?B?VGVycnk=?= said:
My first table with expressions worked after I messed with the relationship
of the tables I had such a mess that I started over. Now the expressions
aren't working.
Pro Rate Table
Auto Num
Unit
MonthlyRent
DailyRent [MonthlyRent]/30
StartDate
EndDate
NumDays [EndDate]-[StartDate]
Amt [MumDays]*[DailyRent]

Originally I had Monthlyrent getting data from another field =adj rent .....
StartDate got data =LeaseStart+30
all the data is in the same table and the same form
any ideas...

My idea is to remove DailyRent, NumDays and Amt from the table. There is
no need to store those values since you can calculate them whenever
needed.
On your form you can add unbound fields with expressions like you
mention ([MonthlyRent]/30).

--
Groeten,

Peter
http://access.xps350.com

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top