Code:
Private Sub btnNewDR_Click()
DoCmd.OpenForm "frmdocrevdetail", , , "fldDocID =" & me.fldDocID, acFormAdd
End Sub
My main form is "frmWIDetail"
In it, I have a sub-form "frmDocReview"
Also on the main form I have a button "btnNewDR"
My plan is to keep a record of reviews (Sub-form "frmDocReview"), connected to main form via union table.
When I press button, I want to add a new record that is in acFormAdd mode, but it's filtered to current record on main form.
Everything is good except when I press the button it opens my form in add mode and fldDocID is set to "0" instead of what ever it is on the main form.
How do I add a new record, but also have the where condition point to a record?
Edit: More info
As per image above, DocID is 0. I want it to be set to what ever the main form is on.
But I also want the form to be in add mode.
Last edited: