Here is the code - I checked the dirty property an it is TRUE when this
code
is run
----------------------------------
Private Sub GrantNum_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
If GrantID = "" Or IsNull(GrantID) Then
GrantID = "temp" & Str(Rnd() * 100)
'Call [frmOrganization].Form.ForceSaveRecord
=============This is where the error is==============
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
==============================================
End If
If Left(GrantID, 4) = "Temp" Then
Me.GrantID = "CSAT" & Me.AutoNum
End If
stDocName = "frmGrants"
PreviousForm = "Organization"
stLinkCriteria = "[GrantID]=" & "'" & Me![GrantID] & "'"
If Me.Contract = "CSAP" Then
msgString = "This is a CSAP Grant"
msgString = msgString + CRLF + CRLF
msgString = msgString + "To Edit info for this grant please use the
CSAP DB Program"
MsgBox msgString, vbOKOnly, "CSAP GRANT"
ElseIf Me.Contract = "CSAT" Then
DoCmd.Minimize
Forms![frmOrganization].Visible = False
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub
Kevin K. Sullivan said:
You don't give the code that causes the error. However, I would suggest
that you put:
Me.Dirty = False
within the subform's event. This will save the subform's data.
Chances are, the subform's data is already saved when your current code
is
run. You can check the saved state with:
If Me.Dirty = True Then
Me.Dirty = False
Else
'do something else / nothing
End If
The subform's data is automatically saved when the focus moves to the
main
form, the subform navagates to a new record, etc.
HTH,
Kevin