Discussions

 View Only
  • 1.  Table Relationships

    Posted 01-16-2022 10:05
    I have a table named Projects.  There are two child tables named Options and PO's.  From the Add PO form I'd like to be able to "Add Options" to the options table by clicking on an "Add Option" button.  The trouble I'm having is that when I click "Add Option" from the Add PO form, the "Add Option" form doesn't relate (auto-populate) the Project that the PO is related to, the related project field is blank and I have to manually type it in.  I can't figure out how to relate the tables and fields so that the "Add Option" form knows which Project it's creating records for.

    Any suggestions are appreciated.

    ------------------------------
    Aaron Lavender
    ------------------------------


  • 2.  RE: Table Relationships

    Posted 01-16-2022 10:56
    Can you clarify the relations you have?  Is options a child of POs as well as Projects?

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Table Relationships

    Posted 01-16-2022 11:04
    Hey Mark, thanks for replying.  I do not have a relationship created between PO's and Options (Job Options).



    ------------------------------
    Aaron Lavender
    ------------------------------



  • 4.  RE: Table Relationships

    Posted 01-16-2022 16:49
    Try this

    try this as a button on Purchase Orders  

    URLRoot() & "db/" & [_DBID_OPTIONS] & "?act=API_GenAddRecordForm&_fid_99=" & [Related Project]

    you will need to check the Properties of the Options table to check if I guessed at the correct _DBID and also check the field ID number for the Related Purchase Order field in options and change the 99 placeholder to that field ID  




    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------