looking for a way around a write conflict...

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:
....
 
J

Jeanette Cunningham

A couple of ideas.
When you open the second form, make the first one hidden - which ever is the
first one of the second one.
I hope that is clear, which ever form you open first, hide it when you open
the second one.
After the Me.Dirty = False, requery the hidden form before opening /
unhiding it.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
M

Mark Kubicki

thanks... got me close enough to an answer to realize that my problem is
coming from "somewhere" else
....how to fix that somewhere? that will be tomorrow's challenge


thnx and good night,
mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top