A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Expression



 
 
Thread Tools Display Modes
  #1  
Old May 12th, 2010, 06:28 AM posted to microsoft.public.access
terry
external usenet poster
 
Posts: 622
Default Expression

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...

  #2  
Old May 12th, 2010, 06:38 AM posted to microsoft.public.access
xps35
external usenet poster
 
Posts: 22
Default Expression

=?Utf-8?B?VGVycnk=?= wrote:


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

  #3  
Old May 12th, 2010, 01:20 PM posted to microsoft.public.access
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Expression

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.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"Terry" wrote in message
...
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...



  #4  
Old May 12th, 2010, 02:40 PM posted to microsoft.public.access
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Expression

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" wrote:

=?Utf-8?B?VGVycnk=?= wrote:


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

.

  #5  
Old May 12th, 2010, 02:43 PM posted to microsoft.public.access
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Expression

Amen to everything Arvin said! Also, you have a typo

Amt [MumDays]*[DailyRent]

MumDays should be NumDays. Whether this simply is a typo in your post here or
a typo in your expression, I can't tell, of course.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/201005/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.