6 Replies - 2366 Views - Last Post: 30 January 2012 - 11:41 AM

#1 sandaruwanc   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 31-August 11

How to find the Total Using Forms In Access 2007

Posted 30 January 2012 - 09:26 AM

Hi, I am making a hotel reservation system using access.. I have two tables and I need to make an calculation using these two table fields, one is Customer duration [Dates of reservation like 4 days...] other one is Package price.. I want to multiply these fields and show it on a form text box , can some one help me to do this?
Is This A Good Question/Topic? 0
  • +

Replies To: How to find the Total Using Forms In Access 2007

#2 nK0de   User is offline

  • Catch me As Exception
  • member icon

Reputation: 206
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: How to find the Total Using Forms In Access 2007

Posted 30 January 2012 - 09:39 AM

Can help you if you show us what you have done so far.. provide the code you've written up to now.
Was This Post Helpful? 0
  • +
  • -

#3 sandaruwanc   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 31-August 11

Re: How to find the Total Using Forms In Access 2007

Posted 30 January 2012 - 09:48 AM

View PostnK0de, on 30 January 2012 - 10:09 PM, said:

Can help you if you show us what you have done so far.. provide the code you've written up to now.

I Have Attached the DB ,just see the payment form, I need to make a calc using Payment [Duration Field] and Pakcages [Price Field]
Was This Post Helpful? 0
  • +
  • -

#4 nK0de   User is offline

  • Catch me As Exception
  • member icon

Reputation: 206
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: How to find the Total Using Forms In Access 2007

Posted 30 January 2012 - 10:01 AM

View Postsandaruwanc, on 30 January 2012 - 09:56 PM, said:

Hi, I am making a hotel reservation system using access.. I have two tables and I need to make an calculation using these two table fields, one is Customer duration [Dates of reservation like 4 days...] other one is Package price.. I want to multiply these fields and show it on a form text box , can some one help me to do this?


If you're asking how to do calculation in a query, its pretty simple. (assuming you have set correct datatypes and all)

SELECT duration * price AS [Calc] FROM table1


you can use any other operator like +, -, / in a query to do calculations.

showing them in a textbox is a programming question actually. This forum is for questions relating databases.
Was This Post Helpful? 0
  • +
  • -

#5 sandaruwanc   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 31-August 11

Re: How to find the Total Using Forms In Access 2007

Posted 30 January 2012 - 10:44 AM

View PostnK0de, on 30 January 2012 - 10:31 PM, said:

View Postsandaruwanc, on 30 January 2012 - 09:56 PM, said:

Hi, I am making a hotel reservation system using access.. I have two tables and I need to make an calculation using these two table fields, one is Customer duration [Dates of reservation like 4 days...] other one is Package price.. I want to multiply these fields and show it on a form text box , can some one help me to do this?


If you're asking how to do calculation in a query, its pretty simple. (assuming you have set correct datatypes and all)

SELECT duration * price AS [Calc] FROM table1


you can use any other operator like +, -, / in a query to do calculations.

showing them in a textbox is a programming question actually. This forum is for questions relating databases.


Just See this..
Access DB - http://sandaruwan.xp..._Paradise.accdb

Plz help me...
Was This Post Helpful? 0
  • +
  • -

#6 nK0de   User is offline

  • Catch me As Exception
  • member icon

Reputation: 206
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: How to find the Total Using Forms In Access 2007

Posted 30 January 2012 - 10:47 AM

I'm sorry but I don't have Access installed in my PC.
Was This Post Helpful? 0
  • +
  • -

#7 June7   User is offline

  • D.I.C Addict
  • member icon

Reputation: 104
  • View blog
  • Posts: 904
  • Joined: 09-December 08

Re: How to find the Total Using Forms In Access 2007

Posted 30 January 2012 - 11:41 AM

First have to join the two tables in query on the Package_ID fields.

Then do calculation in query and this will create a constructed field based on that expression. Then bind textbox ControlSource to this field. Or can do the calculation in textbox:

=fieldname1 * fieldname2

The SQL statement would look like:
SELECT Reservation.Guest_ID, Reservation.Date_Of_Reservation, Package.Price, Reservation.Duration, [Duration]*[Price] AS TotalCost
FROM Package RIGHT JOIN Reservation ON Package.Package_ID = Reservation.Package_ID;

This post has been edited by June7: 30 January 2012 - 11:57 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1