Results 1 to 7 of 7
  1. #1
    Thompyt is offline Expert
    Windows 11 Office 365
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862

    Adding a new record from form

    I am trying to get a new record when opening a form from another form to use as a reference ID in order to update that referenced ID table and other tables in the process. I have tried setting the data flow in both directions for multiple ways. In some the Airfare would be Name? FLID is the same. I Know it's some simple thin. Yes. I know you don't store calculated values in the table, but it's a trouble shooting thing, like the CON_ID/FLID/BAGID fields visible on the forms.



    Basically, I fill out Form 1 FrmProjCosts and select Add flight button to add flight info. The new form 2 FrmAirAvg opens to input data # of Bags, Flight Cost and the Airline. I would want to store the Airline, Airfare and # Bags in TbleFlights, that would later show on Form 1.
    TVLTest.zip
    TVLTest.zip

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    I think your table design is wrong.
    See if this makes more sense and is easier to work with:

    Attachment 52324
    Attached Thumbnails Attached Thumbnails tables_2.png  

  3. #3
    Thompyt is offline Expert
    Windows 11 Office 365
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    davegri,
    I tried without avail.

    Click image for larger version. 

Name:	SnipAccess.png 
Views:	13 
Size:	18.8 KB 
ID:	52335

    TblBag has 3 Bag entries as there are norms for the Airlines to charge different amounts for the first/second/third and beyond baggage. I had the airline included in TblBag as the carrier would coincide on the same row as the bags and you could get the results from that. I gather ina roundabout way that The carrierID is connected to the BagID by: TblBag.CARRID to TblFlights.CARRID across to TblConsolidate.FlightID across to TblConsolidate.BagID to TblBag.BagID. TblBag is only to be read and not to add data. I am using TblConsolidate as the Junction table. I think the difference was my one-to-many relationships was that I did not have the relationships enforced. ANd the placement of BagCost, ExcessBagCost, and BagNum. I believe that your BagTag was for BagNum and BagVal was the sum of the Bag Costs. In the above you have TblFlights.CONID, so I am thinking that was where you would have TblConsolidate.CONID one-to-many relationship?

    Thus, the need for the Junction Table? TblJUNC now adds to the complexity and I cannot add to the table through the forms. This is what I have at this point.

    Click image for larger version. 

Name:	SnipAccess2.png 
Views:	13 
Size:	18.5 KB 
ID:	52334
    Last edited by Thompyt; 10-23-2024 at 08:00 PM.

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    In my design, TblConsolidate is removed and replaced by the junction table and CONID goes away.
    TblBag would have a record for each bag.
    However, if you want to go the bag1, bag2, bag3 in a single record, you don't need the bag table. You could just move your TblBag fields to the junction table.

  5. #5
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    I think there's been a mistake of some sort. I didn't post anything in this thread (or did I and it was deleted?). Sure does not look familiar.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    Thompyt is offline Expert
    Windows 11 Office 365
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    @ Micron, you are correct. I called davegri your name. I apologize to davegri and will correct.

  7. #7
    Thompyt is offline Expert
    Windows 11 Office 365
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    Click image for larger version. 

Name:	AccessFinal.png 
Views:	10 
Size:	18.1 KB 
ID:	52340

    This was the final working output with the VBA in the background.

    Thank you davgri

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

Similar Threads

  1. Replies: 1
    Last Post: 11-19-2018, 07:57 PM
  2. Replies: 6
    Last Post: 05-09-2017, 09:13 AM
  3. Replies: 1
    Last Post: 12-09-2016, 08:58 AM
  4. Replies: 3
    Last Post: 07-01-2016, 08:11 AM
  5. Replies: 4
    Last Post: 08-14-2012, 07:14 AM

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