Results 1 to 10 of 10
  1. #1
    crazyrat25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    12

    trouble displaying query results in a form

    Hi, I am working on a project with my students and I am struggling with one issue in our system. We have a (fake) database for a camping company. We have got the booking system for campsites working great but we have to create an additional section to the system whereby guests can 'logon' to the system using a password that is stored in the customers table with their personal information to book a meal and meal time slot. I have tried to do this with a parameter query on the member password field but



    The meal information is stored in a separate table. Ultimately we have to create an invoice for the camping stay for each guest so need the meal selections added to the booking table I think?

    Everytime I create a query that will load a form with the customer information linked to the meals, I get no results which I assume is because the meal information is blank/not associated with the customers? I have tried Is Null for the blank fields and "" but I cannot get it to work!

    I have screenshots of the system if that helps.

    Click image for larger version. 

Name:	relationship.PNG 
Views:	8 
Size:	23.0 KB 
ID:	22829Click image for larger version. 

Name:	customers.jpg 
Views:	8 
Size:	73.5 KB 
ID:	22830Click image for larger version. 

Name:	query.PNG 
Views:	7 
Size:	18.4 KB 
ID:	22831

    Thanks in advance!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I would recommend that you do not have embedded spaces in field or object names. It will cause syntax issues at some point.

    Is Date of Booking when the "reservation was made", or is it the Date on which the "Stay" starts? You may consider a field for each of these.

    Where is your Meals table? Why is it not in your relationships diagram?

  3. #3
    crazyrat25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    12
    The Date of booking is for when the stay begins. As this is school project There is no requirement for the date the reservation was made (although I understand in reality this would be near essential). The Meals table is actually the menu table. This is given by the exam board. The description field contains the different menu items.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    OK. We don't do homework ( none of the forums do), but if you ask specific questions and show that you are putting in an honest effort, people here will help.

    What is the specific issue at this time?
    What is an example (or 2) of the Description field?

  5. #5
    crazyrat25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    12
    Thanks - not looking for someone to do my work, just help with this issue. I have tried to run the query in the screenshot to 'search' by password for a user. My hope would be to generate a form that would have the customer details on and allow me to select a meal option for that customer, feeding into the booking table so that I can generate the overall invoice. I am fine with booking the campsite - that's already done and I'm fine with making an invoice - I've done it before but cannot get this query to work! In my head it makes sense but obviously in Access it doesn't work the same way!

    I've also screenshot the menu tableClick image for larger version. 

Name:	menu.PNG 
Views:	6 
Size:	23.5 KB 
ID:	22835

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    It appears that your current table structure only allows 1 meal/menu per Customer. Could you please describe/explain what would actually happen if a Customer was on a 3 day stay -assume 3 meals per day. How exactly is that handled in your set up?

  7. #7
    crazyrat25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    12
    Ah, does this mean I need some sort of 'meals' table to record the meal orders? I assume this would allow me to have a many to many relationship?

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Do you understand Many to Many?

    1 customer could select many Meals
    1 meal could be selected by many Customers

    Resolving Many to Many

  9. #9
    crazyrat25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    12
    Now I'm confused again! Maybe I don't understand many to many properly! I've just created a 'meals' table to store orders from the menu and customers but I'm not sure if this will work?Click image for larger version. 

Name:	new relationships.jpg 
Views:	7 
Size:	50.8 KB 
ID:	22837

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I was thinking you could consider a table such as:

    tblCustomerHasMeal
    CustomerID---PK of Customer
    MenuId --------PK of Menu
    mealDate (must be within current booking period)
    whichMeal (Breakfast /Lunch /Dinner)

    From a validation perspective you might check that each meal for each Day of Stay has been considered.
    You might have a separate PK say CustomerHasMealID in tblCustomerHasMeal.
    Then you may wish to review composite unique index to see if it is relevant to your situation.

    It is advisable to create some test data and ensure your model meets your requirement. If there are any issues, review and review to ensure every issue is resolved --could be bad data, missing table, bad relationship...... solve the issue before moving on.

    Another important approach, and we may have overlooked it in this discussion, is:

    Write a clear description of the business issue/opportunity in plain English. Start at the 30,000 ft level and gradually add details. Bounce it off some co-workers to ensure all aspects and facts are consistent and truly represent the business issue to be resolved. This can/should become a reference specification for what you are trying to do/support. Too often people start development and don't have a clear statement of what exactly they are trying to resolve.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 06-03-2015, 10:45 AM
  2. Replies: 1
    Last Post: 10-01-2012, 12:31 PM
  3. Replies: 4
    Last Post: 09-12-2011, 11:52 AM
  4. Displaying query results in form
    By celito in forum Access
    Replies: 2
    Last Post: 08-27-2011, 09:14 AM
  5. Displaying query results within a form
    By Remster in forum Forms
    Replies: 5
    Last Post: 10-05-2010, 09:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums