Hi
I have created a form unbounded into which I get the user to enter some details. I then open a new record in the table and write in the details.
' Adds a new record to a Recordset using the data on the new form
With rstAddAction
.AddNew
!ActionNumber = Me.ActionNumber
!ActionType = Me.ActionType
!StdClauseID = Me.StdClauseID
!NonConf = Me.NonConf
!RootCause = Me.RootCause
!Action = Me.Action
!Progress = Me.Progress
!AuditID = Me.AuditID
!LaboratoryID = Me.LaboratoryID
!BusinessManID = Me.BusinessManID
!RespPerson = Me.RespPerson
!RaisedDate = Me.RaisedDate
!ToQualityDate = Me.ToQualityDate
!ToBMDate = Me.ToBMDate
!FromBMDate = Me.FromBMDate
!ActTargetDate = Me.ActTargetDate
!ActCompDate = Me.ActCompDate
!FollowUP = Me.FollowUP
!QMSignOff = Me.QMClose
!FollowUp2 = Me.FollowUp2
.Update
End With
' Clean up recordsets
rstAddAction.Close
Set rstAddAction = Nothing
Set db = Nothing
I note when examining the running of this code using debug the record is not written directly to the table and at this stage of the code there is no new record in the table.
What I wanted to do is to open the newly saved record in another form so that further data can be input but it is not there to open.
the record only seems to appear once I close the routine.
How do I force the record to be written when I do the .update command so at it appears in the table and I can operate on it.
I have created a form unbounded into which I get the user to enter some details. I then open a new record in the table and write in the details.
' Adds a new record to a Recordset using the data on the new form
With rstAddAction
.AddNew
!ActionNumber = Me.ActionNumber
!ActionType = Me.ActionType
!StdClauseID = Me.StdClauseID
!NonConf = Me.NonConf
!RootCause = Me.RootCause
!Action = Me.Action
!Progress = Me.Progress
!AuditID = Me.AuditID
!LaboratoryID = Me.LaboratoryID
!BusinessManID = Me.BusinessManID
!RespPerson = Me.RespPerson
!RaisedDate = Me.RaisedDate
!ToQualityDate = Me.ToQualityDate
!ToBMDate = Me.ToBMDate
!FromBMDate = Me.FromBMDate
!ActTargetDate = Me.ActTargetDate
!ActCompDate = Me.ActCompDate
!FollowUP = Me.FollowUP
!QMSignOff = Me.QMClose
!FollowUp2 = Me.FollowUp2
.Update
End With
' Clean up recordsets
rstAddAction.Close
Set rstAddAction = Nothing
Set db = Nothing
I note when examining the running of this code using debug the record is not written directly to the table and at this stage of the code there is no new record in the table.
What I wanted to do is to open the newly saved record in another form so that further data can be input but it is not there to open.
the record only seems to appear once I close the routine.
How do I force the record to be written when I do the .update command so at it appears in the table and I can operate on it.