R
Randy
I have a code (see below) that keeps receiving a run-time error (2166) that
states "you can't lock a control while it has unsaved changes"...I have in my
code a command that should save the record before it actually locks the field
but for some reason does not seem to work.
Can anyone see what might be wrong with my code that would be causing this
to happen? Here is my code:
Private Sub NoResponse_Checkbox_Click()
If Me!NoResponse_Checkbox = True Then
Me!Update_Letter_Comments.Locked = False
DoCmd.GoToControl "Update_Letter_comments"
SendKeys "{Right}", True
SendKeys "{Enter}", True
SendKeys "No response to Update Letter. Applicant has been
de-activated as of this date ", True
SendKeys Now(), True
DoCmd.Save
Me!Update_Letter_Comments.Locked = True
Me!In_Active_Reasons = 5
Call In_Active_Click
DoCmd.GoToPage 1
End If
End Sub
Any suggestions/advice will be greatly appreciated. I thank you in advance
for any assistance you may be able provide.
states "you can't lock a control while it has unsaved changes"...I have in my
code a command that should save the record before it actually locks the field
but for some reason does not seem to work.
Can anyone see what might be wrong with my code that would be causing this
to happen? Here is my code:
Private Sub NoResponse_Checkbox_Click()
If Me!NoResponse_Checkbox = True Then
Me!Update_Letter_Comments.Locked = False
DoCmd.GoToControl "Update_Letter_comments"
SendKeys "{Right}", True
SendKeys "{Enter}", True
SendKeys "No response to Update Letter. Applicant has been
de-activated as of this date ", True
SendKeys Now(), True
DoCmd.Save
Me!Update_Letter_Comments.Locked = True
Me!In_Active_Reasons = 5
Call In_Active_Click
DoCmd.GoToPage 1
End If
End Sub
Any suggestions/advice will be greatly appreciated. I thank you in advance
for any assistance you may be able provide.