B
Bonnie
Hi there! Using A02 on XP. I set my table with a multiple
key index to avoid duplicate records. When clicking the
Close button, the duplicates were not being added but no
message was telling them they weren't. I added the save
record line and now we get the message that the record
couldn't be added yada yada and you are back on the form
still in edit mode with nothing saved. If I then change
the data in the field that is keeping me from saving the
record and click the Close button again I get the
Microsoft Access - Reserved Error. Click okay on the
error, click the Close button one more time and it closes
and saves the corrected new record. What am I doing wrong?
Private Sub CloseButton_Click()
On Error GoTo Err_CloseButton_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.close
Exit_CloseButton_Click:
Exit Sub
Err_CloseButton_Click:
MsgBox Error$
Resume Exit_CloseButton_Click
End Sub
Thanks in advance for ANY help or advice!!!
key index to avoid duplicate records. When clicking the
Close button, the duplicates were not being added but no
message was telling them they weren't. I added the save
record line and now we get the message that the record
couldn't be added yada yada and you are back on the form
still in edit mode with nothing saved. If I then change
the data in the field that is keeping me from saving the
record and click the Close button again I get the
Microsoft Access - Reserved Error. Click okay on the
error, click the Close button one more time and it closes
and saves the corrected new record. What am I doing wrong?
Private Sub CloseButton_Click()
On Error GoTo Err_CloseButton_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.close
Exit_CloseButton_Click:
Exit Sub
Err_CloseButton_Click:
MsgBox Error$
Resume Exit_CloseButton_Click
End Sub
Thanks in advance for ANY help or advice!!!