Skip to main content
Question

How to create a new record button in a form to another table

  • February 23, 2022
  • 0 replies
  • 90 views

How can add a "new record" button to another table with a form and have it populate a certain field from the from?

So passing along the right value through the button url into the form?

------------------------------
Lashell Thomas
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
The generic format would be like this assuming that the other table is in the same app.

URLRoot() & "db/" & [_DBID_of the other table from advanced properties]
& "&_fid_10=" & URLEncode([field 1])
& "&_fid_11=" & URLEncode([field 2])
& "&_fid_12=" & URLEncode([field 1])

// this last line is optional and will cause the user to land on the record or report they started form when clicking as opposed to the newly created record.
& "&z=" & Rurl()

The URLEncode is required when the value being put into the URL might have any characters which are not A-Z or 0-9, as some of them don't travel through the magic of the internet.  For example URL do not ever have spaces.

It a best practice to refer to the target table by its table alias from Advanced Properties of the table.  That way if you copy the app it will still work.  If its going to be a cross app ADD button then you will need to hard code the table code.

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