M
Mark Kubicki
I have 2 forms which share a common a table (frmmainMenu, and
frmFixtureSchedulePrintOptions)
On the first form (frmMainMenu), there is a command button that opens the
second form (frmFixtureSchedulePrintOptions) -the 2nd NEVER opens otherwise
(it is ALWAYS opened by the first)
when the 2nd form (frmFixtureSchedulePrintOptions) is closed, focus ALWAYS
returns to the first
the problem is that for the one field that is common to both, if it has been
changed on the first form, when I open the 2nd form, I get a write conflict
error
(oddly, if I change it on the second... I do not notice the conflict when
closing that form and returning to the 1st
The field entry on the current form should always take precedent for the
field value.
I thought that a work-around would be to simply save the current record and
set dirty = false before I change forms, but that is not working...
any suggestions would be greatly appreciated
many thanks in advance,
mark
--------------------------------------------------------------------------------------
Private Sub cmdFixtureSchedulePrintOptions_Click()
On Error GoTo Err_cmdFixtureSchedulePrintOptions_Click
'this didn't work
' With Me.Form.RecordsetClone
' .Edit
' .Update
' .Bookmark = .LastModified
' Me.Form.Bookmark = .Bookmark
' End With
' DoCmd.Close
'this didn't work
' DoCmd.RunCommand acCmdSaveRecord
' DoCmd.Close
'this didn't work
' DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'this didn't work
' Dim rst As Recordset
' rst = Me.RecordsetClone
' With rst
' .Edit
' .Update
' .Bookmark = .LastModified
' Me.Form.Bookmark = .Bookmark
' End With
'this didn't work
' Me.Dirty = False
'currently, I'm trying this code, but it's not working either
If Me.Dirty Then
RunCommand acCmdSaveRecord
End If
DoCmd.Close
'this is where I open the second form
stDocName = "frmFixtureSchedulePrintOptions"
DoCmd.OpenForm stDocName, acNormal
Exit_cmdFixtureSchedulePrintOptions:
....
frmFixtureSchedulePrintOptions)
On the first form (frmMainMenu), there is a command button that opens the
second form (frmFixtureSchedulePrintOptions) -the 2nd NEVER opens otherwise
(it is ALWAYS opened by the first)
when the 2nd form (frmFixtureSchedulePrintOptions) is closed, focus ALWAYS
returns to the first
the problem is that for the one field that is common to both, if it has been
changed on the first form, when I open the 2nd form, I get a write conflict
error
(oddly, if I change it on the second... I do not notice the conflict when
closing that form and returning to the 1st
The field entry on the current form should always take precedent for the
field value.
I thought that a work-around would be to simply save the current record and
set dirty = false before I change forms, but that is not working...
any suggestions would be greatly appreciated
many thanks in advance,
mark
--------------------------------------------------------------------------------------
Private Sub cmdFixtureSchedulePrintOptions_Click()
On Error GoTo Err_cmdFixtureSchedulePrintOptions_Click
'this didn't work
' With Me.Form.RecordsetClone
' .Edit
' .Update
' .Bookmark = .LastModified
' Me.Form.Bookmark = .Bookmark
' End With
' DoCmd.Close
'this didn't work
' DoCmd.RunCommand acCmdSaveRecord
' DoCmd.Close
'this didn't work
' DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'this didn't work
' Dim rst As Recordset
' rst = Me.RecordsetClone
' With rst
' .Edit
' .Update
' .Bookmark = .LastModified
' Me.Form.Bookmark = .Bookmark
' End With
'this didn't work
' Me.Dirty = False
'currently, I'm trying this code, but it's not working either
If Me.Dirty Then
RunCommand acCmdSaveRecord
End If
DoCmd.Close
'this is where I open the second form
stDocName = "frmFixtureSchedulePrintOptions"
DoCmd.OpenForm stDocName, acNormal
Exit_cmdFixtureSchedulePrintOptions:
....