I have one table set up as having absolute authority, with it being parent to several other tables. For most child records, the parent record already exists in the table when they're created. However, I'm running into a situation where I'm trying to create a child record when the parent record is still brand new in the form. It may or may not have been saved. I want to create the parent record before appending to the child, but I don't want to /keep/ saving the parent record.
I've tried doing a Form_Load DoCmd.Save, it would appear to not have the record reserved at that point.
Here's what I'm doing right now:
Private Function SubmitUpdate(step As String) DoCmd.RunCommand acCmdRefresh 'this forces the record to save, preventing a conflict where 'we try to create a child record without a relevant parent record in the parent table. Me.txtStep.Value = step 'used to pass the variable to a field so it can be used in the query DoCmd.SetWarnings False 'don't need to ask the user for permission to create the log record constantly DoCmd.OpenQuery "qappProcessLog", acViewNormal, acEdit DoCmd.SetWarnings True Me.sfrmProcessLog.Requery End Function
Any suggestions would be more than welcome. What I have now functions as I need it to, but I would prefer not to save every time that function is run. Since the function is creating an activity log that records whenever an action is performed, it's fairly frequently. It's possible to open the form and have that be run in the first Subroutine performed by the user, so I need it saved before that point.