Saving & Closing form before progressing

deere8585

Registered User.
Local time
Today, 17:16
Joined
Jun 26, 2008
Messages
27
Hi all,

I have 3 forms Entry/Analysis/Follow Up, these let users add info into records held in 1 table- Active Complaint.

The entry form has a command button that opens the analysis form & the analysis form has a command button to open the follow up form-

however if someone goes through the whole process at once i.e. enters the info in the entry form then clicks the command button to take them to the analysis form enters the info into that form & the same from analysis to follow up a Write Confilct appears saying 'the record has been changed by another user since you started editing it.....'

I think this is because my command buttons only open the next form and so you have 2 forms open entering info in the same record of the same table-am I correct?

Assuming this is so I've tried the following amendments to the command button 'on click event'
Private Sub Analysis_Click()
On Error GoTo Err_Analysis_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ComplaintAnalysis"

stLinkCriteria = "[RecordNumber]=" & Me![RecordNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Analysis_Click:
Exit Sub
Err_Analysis_Click:
MsgBox Err.Description
Resume Exit_Analysis_Click

DoCmd.Save
DoCmd.Quit

But it does not appear to be working-I would really appreciate if someone couls point out where I'm going wrong!!!!!

Many thanks
 
Try this to save the record:

DoCmd.RunCommand acCmdSaveRecord
 
Thank you- I put that line in at the start of the code and it appears to prevent the Write Conflict message box appearing!
 

Users who are viewing this thread

Back
Top Bottom