Copy data from one subform to another

nomax

Registered User.
Local time
Today, 10:19
Joined
Dec 20, 2015
Messages
21
I've been lurking and have with the help of this forum been able to design an access database to do almost everything I need. I am stuck on this one issue and cannot find a logical solution.

I will try and provide as much info as possible.

FORM1; Group Master - this form contains a subform called Itinerary - this subform can contain from 3 to 14 lines of information depending on the length of the cruise - I have a control box that opens the second form to add the individual booking details.
FORM2: Individual booking from Master - I have been able to update this form with all of the information I need from FORM 1 except for the itinerary details. Do I add the subform from FROM 1 to this form? If so, how do I copy the information from FORM1 automatically. Or is there a simplier way to do this.

I think this might be an easy fix that I am just not thinking of.:banghead:
 
How is this set up? Are the Cruises and their itineraries fixed or do the itineraries vary for the same cruise? If they don't vary then when you book a cruise the booking would get the Id for the cruise and the related itinerary records would be in the subform because of the linking between the form and subform.

If the itineraries vary by booking then you will have to run an append query that would append records from the master table to the table which hold the specific bookings.

Could you post a screen shot of you table relationships? It might help me understand your situation better.
 
"How is this set up? Are the Cruises and their itineraries fixed or do the itineraries vary for the same cruise?" They do not vary by Group Cruise, but each Group would have it's own itinerary

Actually ran into my second problem which I think will need to be a different post - FORM1: Group FORM2: Ind within group - so on FORM2 I used a combo box to populate multiple fields from FORM1 (all the information that will repeat for each individual booking within the group). When opening the report from FORM2 these fields are blank - the info doesn't pull over.
 
Your post refer to forms as though they were sources of a data and so I'm having a hard time understanding the problem. If you could explain this in terms of your data (tables) and tell us what you are doing in more detail it would help. Uploading your database would be help too.
 
I'm new to posting, not sure how to upload my database. Maybe I can explain it a little better

FORM1: Group Master - this form contains all of the information for the "GROUP" in total - total cabins, total price, total commission etc. and all of the cruise details including a subform for the itinerary. The only reason I choose to use a subform is because this information can (and will) change from one cruise to another and the amount of lines will change depending on the length of the cruise.

When a guest books into the GROUP, I use FORM2 - Form2 pulls all of the details from FORM1 except for the information for this individual booking within the group. I need to also include the itinerary on this form - this form generates the report that is sent to the customer. I am trying to find a way to populate the subform Itinerary on FORM2 with the same information from the subform on FORM1.

I am having no problem populating FORM2 with all of the information I need except for the information in the SUBFORM.

Does this make sense? Or is there a better way to do it that I am not aware of?
 
I use FORM2 - Form2 pulls all of the details from FORM1

This doesn't make sense to me and implies that Form1 would have to be open and you would have code like:

Me.Combo1 = Forms!Form1!Combo1

If that's the way you are doing it I'm fairly certain there's a better way. Furthemore you couldn't even do that from a subform with continuous forms as there's no way to distinguish one form from the other. The data has to come from the table.

See http://www.access-programmers.co.uk/forums/faq.php?faq=vb3_reading_posting#faq_vb3_attachments for info on how to upload your database. I think there's a 1 MB limit so you might need to compact and repair your data and/or put it in a zip file.
 
Trying to make it make sense - I will need to put these/tables/forms into a new database to upload them. I will work on that during the week.

Yes - Form 1 is open - the control button to add an individual booking under the group is on FORM 1 - so CLICK AND FORM2 Opens and most of the information is pre-populated from form 1.

I've attached snippets of form 1 and form 2 - the highlighted fields on FORM2 are automatically updated with the information from FORM 1
 

Attachments

  • FORM 1.JPG
    FORM 1.JPG
    93 KB · Views: 103
  • FORM 2.JPG
    FORM 2.JPG
    75.6 KB · Views: 102
Ok it appears the form2 is more or less a continuation of form1 and therefore would be bound to the same table. If that the case then the subform on should have the same record source as form1 and the Link Master and Link Child field of the subform should be about the same as they are in form1, probably the Group ID. When all of that's in order you should see the itinerary once the linkid is populated on form2.
 
I knew I was missing something simple sneuberg and you gave me the key to accomplish what I needed. Thank you very much.
 

Users who are viewing this thread

Back
Top Bottom