Hello, I have a form and subform I close with the code [code]
Private Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
On Error Resume Next
KeyNum KeyCode =
If KeyCode = 39 And Me.Note.SelLength> 0 Then
Me.Note.SelLength = 0
Me.Note.SelStart = Len (Me.Note.Text)
end If
On Error GoTo 0
If KeyCode = vbKeyEscape Then btnClose_Click
end Sub
Private Sub btnClose_Click ()
On Error GoTo Err_btnClose_Click
DoCmd.Close acForm, "F_main2"
Exit_btnClose_Click:
Exit Sub
Err_btnClose_Click:
MsgBox Err.Description
Resume Exit_btnClose_Click
End Sub [/ code]
At the end, however, it asks me to save the form and the subform. How do I change the code so that everything is saved when I go out?
thanks
Hello