[AccessD] Second Try

Arthur Fuller fuller.artful at gmail.com
Thu Mar 10 18:51:33 CST 2022


Earlier today I posted a message, or thought I did, but haven't seen it
appear yet, so I'm resending it.

I have a form in datasheet format. It's actually a subform. The bottom row
contains the word New. When I click this, I open a single-row form that
allows editing or addition, depending on the argument I pass. The problem
is that when adding a new row, the form does not inherit the parent key.
For example, if I'm trying to add an Order Detail, it does not inherit the
Order_ID. I have tried a few approaches but am not getting what I want.

This does not work.
<code<
    DoCmd.OpenForm "Order_Detail_frm", View:=acNormal, DataMode:=acFormAdd
    Me.Order_ID = Me.Parent.OrderID
'    DoCmd.OpenForm "Order_Detail_frm", acNormal, , "ID=" & Me.ID,
acFormEdit, acDialog
</code>
Any suggestions?

Arthur


More information about the AccessD mailing list