Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2006
    Posts
    4

    Unanswered: Calculated fields on forms

    I have created a hotel reservation db with four tables. One is the Tea Room.
    I have set legal values to it and validation rules. (ie: user must enter enter either coffee, tea, juice, danish etc.) and will recieve an error message if the food item field is left blank.
    My Tea Room form has a combo box for the food items and a combo box for the beverage. I want this form to calculate the number of items and enter a total. I have been at this for quite a while and I need some help.

    I think the best way to approach this is by creating a calculated field on a query and using the query on the form but I am stuck.

    This form has a receipt ID and a Room ID. The Room ID property is in the tea table and in the rooms table. The whole idea is to charge items directly to the room and include this on the room charge report that I have to create.

    Thanks for your help.

    Sylvia

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    what does your back end look like?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Apr 2006
    Posts
    4
    I do not understand the question.

  4. #4
    Join Date
    Apr 2006
    Location
    Huddersfield, UK
    Posts
    154

    Post

    greets;

    they way i would do this would be to have the following tables:

    Rooms
    Food & Beverages
    Sales

    I would in the table sales use the lookup and associate sales to rooms and beverages. The only snag with this, as each item is sold, there would be a seperate transaction id... you may have figured a better way around..


    Then the query would group all the sales by room; and have the calculated field at the end come up with the total for that room.

    here is a simlair post with an example, where this is counting by group, you could change it to the calculation. http://www.dbforums.com/showthread.php?t=1216152

    I'll try and do an exmaple to show you what i am babbling about.

    Dan

    btw (backend = tables and field structure etc) so what does your backend looklike means what tables & fields & queries do you have?
    sometimes simple is best.... and i'm just a simple fellow.

  5. #5
    Join Date
    Apr 2006
    Location
    Huddersfield, UK
    Posts
    154

    Arrow Example attached

    Computer Chick;

    in this example i created for you i used the method i mentioned previously. you'll probably need to tweak it to fit your db, but it gives the gist of how i would go about achieving that result.

    It uses one query (query is sales per room) that can handle the totaling, so that it can be displayed on a form (form is sales by room) through a list box.

    There is another query if you need to do itemised recipts. this way (as you'll be printing the recipts), i would personally use a report and do the totalling through the report. the report can group by room, and in the footer you can add =SUM([cost]) to a unbound text box, to add the values in each group for you. you'd need to put the total text box in the group footer for the room group.

    Hope all is helpful, let me know if otherwise.

    Dan
    Attached Files Attached Files
    sometimes simple is best.... and i'm just a simple fellow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •