Results 1 to 11 of 11
  1. #1
    meena is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    13

    Form and Sub form How to use ????


    I have a form to add new records into a table. I.e for one Booking ID I could have multiple records. As I save each of my information, I need these saved records in my subform
    which is by a query using my Booking ID keyed in the main form as a parameter for the retrieval. Bothe the main form and the subform are from the same table.However it does not happen. Please help.

  2. #2
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Hello Dear meena
    Attach example for see

  3. #3
    meena is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    13
    · I am inserting this information in Itinerary_Bookingdts table when the save button is clicked.
    · As I add the other services or attractions for the same Booking id I need all the saved itinerary to appear in my below subform
    · I am passing the booking id as a parameter to the query using which I have created the subform.

    SELECT Itinerary_Bookingdts.BookingID, Itinerary_Bookingdts.IDate, Itinerary_Bookingdts.ServiceType, Itinerary_Bookingdts.ServiceDesc, Itinerary_Bookingdts.ServicedDetails, Itinerary_Bookingdts.AdultPrice, Itinerary_Bookingdts.ChildPrice, Itinerary_Bookingdts.NoofAdults, Itinerary_Bookingdts.NoofChild,
    FROM Itinerary_Bookingdts
    WHERE Itinerary_Bookingdts.BookingID=Forms![FrmdaywiseItineraryfinal]!txtbookingid
    ;Click image for larger version. 

Name:	AccessForum Q1.jpg 
Views:	11 
Size:	192.5 KB 
ID:	17325

  4. #4
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    See this example
    Attached Files Attached Files

  5. #5
    meena is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    13
    Hello Azhar,

    I have attached my database for your perusal. One booking ID has multiple records. As I add and save, I want the information from the table to be displayed in my subform.
    Attached Files Attached Files

  6. #6
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    take a look at how we go about doing this in practice
    http://ms-access-tips.blogspot.com/2...ationship.html

    You have to set up relationships between tables
    Thread above shows you that
    Relationship must be established
    Basic keys and sub-
    Where are they?

  7. #7
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    See Amendment
    Attached Files Attached Files

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Add the following line
    Me.Frmdaywiseitinerarydatasheet_subform.Requery

    just before
    MsgBox ("Record was successfully saved")

    Make sure you include the underscore in the name of your subform container
    Frmdaywiseitinerarydatasheet_subform

  9. #9
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    It can be converted to the organization's logo logo transparent in line with any color of the Form .
    Attached Thumbnails Attached Thumbnails h.gif  

  10. #10
    meena is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    13
    Quote Originally Posted by ItsMe View Post
    Add the following line
    Me.Frmdaywiseitinerarydatasheet_subform.Requery

    just before
    MsgBox ("Record was successfully saved")

    Make sure you include the underscore in the name of your subform container
    Frmdaywiseitinerarydatasheet_subform
    Thank you so much.. Perfect!!! It worked the way I wanted it to.

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Not a problem. I recommend you look into some of the suggestions of azhaar2006 by studying up on Normalization and Relational Database fundamentals.
    https://www.accessforums.net/tutoria...ase-45451.html

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

Similar Threads

  1. Replies: 0
    Last Post: 06-03-2014, 05:15 AM
  2. Replies: 8
    Last Post: 05-22-2014, 10:19 PM
  3. Replies: 2
    Last Post: 04-01-2013, 04:23 PM
  4. Replies: 6
    Last Post: 09-02-2012, 04:30 PM
  5. Replies: 9
    Last Post: 02-15-2011, 03:05 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