Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
Access GroupsView
Access Activexcontrol
Access Adp SQL Server
Access Dataaccess Pages
Access
Access Devtoolkits
Access Externaldata
Access Forms
Access Formscoding
Access Gettingstarted
Access Macros
Access Modulesdaovisual Basica
Access Modulesdaovisual Basica Ado
Access Multiuser
Access Queries
Access Replication
Access Reports
Access Security
Access Setupconfig
Access Tablesdbdesign
Access Modulescoding

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Apps
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft Access Posts  Ask A New Question 

Adding columns in a table / fields in form

Sklyn posted on Wednesday, November 04, 2009 12:03 AM

Hi and thanks for taking the time to help,

In my table of Financial Info relating to vehicles I am trying to calculate
the total monthly cost.
In my table I have columns "MonthlyCost" , "MonthlyGST", and
I would like TotalMonthlyCost to be calculated from the other 2.
In my searching it seems I am better to not have this in the table at all,
but to calculate it in a query/form each time.
I do need it to show in a data entry form.
I will also need to be able to add all the TotalMonthlyCosts from many
vehicles for a GrandTotal Cost in a report perhaps.

What is the best way to go about this and how?
Please try keep it simple as i am fairly new to Access.

Thankyou muchly.
reply

 

Totals should not be stored in a table.

KARL DEWEY posted on Wednesday, November 04, 2009 11:09 AM

Totals should not be stored in a table.  Your table should collect cost,
type, and cost_date records and then use query, form, or report to calculated
totals.
The field used for date needs to be datatype DateTime.

--
Build a little, test a little.
reply

wrote:Exactly.

John W. Vinson posted on Wednesday, November 04, 2009 4:01 PM

Exactly.


Set the Control Source of the textbox for TotalMonthlyCost to

=[MonthlyCost] + [MonthlyGST]

or, if the GST might be NULL,

=[MontlyCost] + NZ([MonthlyGST])

The NZ() function will replace a NULL value with a zero.


A Totals query or a call to DSum would probably be appropriate... for a more
detailed answer post a more detailed question (e.g. *which* of the many
vehicles? how do you choose them?)

--

John W. Vinson [MVP]
reply

Thanks heaps, so far so good :)here is some more detail.

Sklyn posted on Wednesday, November 04, 2009 9:13 PM

Thanks heaps, so far so good :)

here is some more detail. I am keeping track of the vehicles not the payments
as such (for asset control not financial control, though finance will use
some info). Some vehicles are purchased (no monthly costs) some are leased
(has monthly cost) some are charged GST (pay tax on). There is not really a
payment date as such (as payment is always the same each month and is direct
debit), only Purchase date or lease commence date.
Vehicles belong to different Branches and Departments within the company so
I would like to be able to give a total monthly cost for all vehicles in the
branch "Remote Health", though there will still be data for vehicles which
have been disposed of and no longer cost but the dta will still be there. So
will need to filter for all "Current vehicles" in the CurrentStatus field,
then all "Remote Health" vehicles. and total the "Total monthly cost".
Also need to be able to Total for "All Other Branches" Current vehicles
I believe this should all be done on reports?
How much detail do you want of my Table structure? as the Branches, etc are
stored on a related table to the financial info. Should I combine this to one
table?
The main reason I made it a seperate table is to make it easier for creating
forms and to reduce table size, i "think" it would still be fairly normalised
if combined.

My table (_FinancialInfo) contains the following column Headings:

VehicleVIN#  pk and 1-1 relationship with _VehicleDetails(VehicleVIN#) also pk
PurchaseOrLeaseType
Purchase/LeaseStartDate
MnthlyPaymentincStamp
MnthlyGSTAmount
TotalMnthlyPayment  -- Which will be deleted
FundingBudget

along with a bunch of other details irrelevant to this.

My table (_VehicleDetails) contains the following column Headings:
VehicleVIN#  pk  1-1
CurrentStatus
Branch
SubSectionDept
Program

and other details also.


Thanks again for you help.
reply

 
 

Previous Microsoft Access conversation.