D
david
Hello. I have a form with a subform. I have built buttons on the
main form to perform Edit and Save actions. In other words, the user
must click the Edit button in order to edit the record, and then click
Save to save changes (or click the Cancel button to undo).
When I edit a field in the subform and immediately click Save, Access
crashes and exits. The changes I made are saved, however.
If I edit a subform field, then edit a main form field and then click
Save, then there is no crash.
Has anyone seen this before, and how can I get around this? I've
included All referenced fields are on the main form. Note that if I
comment out the entire IF block, then the problem goes away. I don't
understand why that should work - when I click on the Save button,
doesn't that change the focus to the main form, and thus the Me field
references should work?
This is in an Access ADP connecting to a SQL 2000 back end. I am
running Access 2002 SP3 on Windows XP SP1.
Private Sub cmdSave_Click()
'These dates are the Preparation category
If Not IsNull(Me.Request_Received) Or Not
IsNull(Me.Requirements_Mtg) Or Not IsNull(Me.Est_Completion) Or Not
IsNull(Me.Job_Estimate) Or Not IsNull(Me.Media_Requested) Then
Me.Cert_Status_ID = 1
End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
….
….
End Sub
main form to perform Edit and Save actions. In other words, the user
must click the Edit button in order to edit the record, and then click
Save to save changes (or click the Cancel button to undo).
When I edit a field in the subform and immediately click Save, Access
crashes and exits. The changes I made are saved, however.
If I edit a subform field, then edit a main form field and then click
Save, then there is no crash.
Has anyone seen this before, and how can I get around this? I've
included All referenced fields are on the main form. Note that if I
comment out the entire IF block, then the problem goes away. I don't
understand why that should work - when I click on the Save button,
doesn't that change the focus to the main form, and thus the Me field
references should work?
This is in an Access ADP connecting to a SQL 2000 back end. I am
running Access 2002 SP3 on Windows XP SP1.
Private Sub cmdSave_Click()
'These dates are the Preparation category
If Not IsNull(Me.Request_Received) Or Not
IsNull(Me.Requirements_Mtg) Or Not IsNull(Me.Est_Completion) Or Not
IsNull(Me.Job_Estimate) Or Not IsNull(Me.Media_Requested) Then
Me.Cert_Status_ID = 1
End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
….
….
End Sub