Forums: Saving Primary table form data before adding Secondary Table form data - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Saving Primary table form data before adding Secondary Table form data Rate Topic: -----

#1 User is offline   swiersman 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 57
  • Joined: 14-July 06

Posted 11 April 2018 - 08:53 PM

Hi All,

I have parent table called DEPLOYMENTCONSOLE and a child table called DETAIL.

They are joined together as follows - DEPLOYMENTCONSOLE/ID --> DETAIL/DeploymentID.

DETAIL/DeployentID is set up as a foreign key so that for each child record created the DETAIL/DeploymentID inherits the DEPLOYMENTCONSOLE/ID automatically incrementally assigned number by the DB.

THE PROBLEM:

When adding a new record through a form that contains both the DEPLOYMENTCONOSLE and DETAIL table fields, I go to save and get an error that it cannot insert a null into the DETAIL/DeploymentID field.

This makes sense since when adding a new record the DEPLOYMENTCONSOLE/ID # assigned by the DB will not be assigned until after the record is created.

Is there as way I can either:

1. Get the next DEPLOYMENTCONSOLE/ID number from the DB when loading the add page.
2. A way to be able to save the DEPLOYMENTCONSOLE form data to DEPLOYMENTCONSOLE DB first then continue to add the form data for the DETAIL table in the ADD page.(Since now the DEPLOYMENTCONSOLE/ID will be assigned.)

I know I can input the DEPLOYMENTCONSOLE form data, Save and reopen and add the DETAIL form data in the Edit Page .I tried setting it up in the PAGES tab to Open in Edit Page after Add but is very clunky.

Any help would be greatly appreciated,

Scott
0

#2 User is online   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15956
  • Joined: 03-February 03

Posted 12 April 2018 - 05:46 AM

This sounds a bit confusing. Master-details and joined tables are two different things. Do not join tables if you need to link them as master-details.

You have an option to Add/Edit master and details together on the same page. Just do not join them.
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked