I have a form linking two tables that has a couple lookup fields. These lookup fields autofill when a a specific drop-down field is filled. This form can also be accessed via a "add new" button when you click on a record in a different table. When you click on the "add new" button, all the fields autofill with the information of the record that you came into the form from, except for the drop-down field. That stays blank, and when you press save, the autofilled information is not saved, despite being visible in the form.
Why won't my drop-down field autofill when the form is accessed through the record that the drop-down menu is supposed to select?
And also the nature of the "autofilled" information - are these lookup fields? Or fields that are autofilled using form rules, default values, etc.
The dropdown field is the reference proxy for the "details table." The link to the details table form is found on each master table record. Master table information fills all the "details table" lookup fields, and I'm trying to get the reference field (dropdown field) to autofill as well.
Right now, because the dropdown reference proxy field is not autofilling, the record is getting saved with blanks in all the lookup fields.
Sorry for the confusion. I hope that clarifies. And thank you!
Please post the formula for the Add button. Normally - when you add a new relationship - the Add button already has parameters in there to fill in the "Related Parent". We want to make sure that's happening in this case.
Also - we will need to know what the reference field is from the Details up to the Master - usually it's the Record ID# of the parent, called something like [Related Parent].
On the upper right, click on "Advanced Options", and check "Field Id".
Then check what the Field Id is for [Related Parent].
If the Add button was already working correctly, the Field Id would be 11.
URLRoot() & "db/" & [_DBID_(child table)] & "?a=API_GenAddRecordForm&_fid_11=" & URLEncode ([Record ID#])& "&z=" & Rurl()
That's what the bolded part in the Add button formula above is doing - filling in the field with Field ID = 11 - with the Record ID of the current record on the Parent table. This in effect sets the reference field (and also reference proxy, and all the other lookup fields) to the correct related Parent recod.
However - if the Field Id of [Related Parent] is NOT 11, this won't work. So you'd need to update "&_fid_11" to match the Field Id of [Related Parent], whatever it is - 17, 21, etc.