C
Christopher Glaeser
The sample code that follows is used to open a form and pre-fill some of the
fields ...
DoCmd.OpenForm "frmMyForm", DataMode:=acFormAdd
Forms!frmMyForm!ContactName = Me.ContactName
Forms!frmMyForm!ContactAddress = Me.ContactAddress
This is similar to setting frmMyForm default values, except the code above
sets the Dirty bit, and the autonum used for frmMyForm primary key is
allocated. Default values do not set the Dirty bit, and the autonum is not
allocated until the user begins to edit the form. Is it possible to
programmatically pre-fill fields in a form without setting the Dirty bit? I
want users to be able to be able to review and possibly cancel the
pre-filled form without allocating the next autonum. Of course, I could
maintain the pre-filled data in a temporary form and then copy the data to
the real form if the user does not click Cancel, but I was curious if Access
supported this feature directly. Perhaps something like ...
DoCmd.OpenForm "frmMyForm", DataMode:=acFormAdd, _
ContactName:=Me.ContactName, _
ContactAddress:=Me.ContactAddress
Best,
Christopher
fields ...
DoCmd.OpenForm "frmMyForm", DataMode:=acFormAdd
Forms!frmMyForm!ContactName = Me.ContactName
Forms!frmMyForm!ContactAddress = Me.ContactAddress
This is similar to setting frmMyForm default values, except the code above
sets the Dirty bit, and the autonum used for frmMyForm primary key is
allocated. Default values do not set the Dirty bit, and the autonum is not
allocated until the user begins to edit the form. Is it possible to
programmatically pre-fill fields in a form without setting the Dirty bit? I
want users to be able to be able to review and possibly cancel the
pre-filled form without allocating the next autonum. Of course, I could
maintain the pre-filled data in a temporary form and then copy the data to
the real form if the user does not click Cancel, but I was curious if Access
supported this feature directly. Perhaps something like ...
DoCmd.OpenForm "frmMyForm", DataMode:=acFormAdd, _
ContactName:=Me.ContactName, _
ContactAddress:=Me.ContactAddress
Best,
Christopher