From: Ray on
Hello and happy holidays...

I have an issue i hope I can find the answer to. I have a password protected
command button on a form that will duplicate the record when the password has
been entered. The form then duplicates the record but the problem is an
Unbound textbox named "txtFindAsUTypeValue" is causing Error 3020 Update of
CancelUpdate without AddNew or Edit on txtFindAsUTypeValue_Change and i can
not move to any other records or complete any other actions.

Here is the code i am using for the commad button that duplicates the record:

Private Sub DupCurrentIssue_Click()

'Attached to On Click event of DupCurrentIssue

Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'If correct password is entered copy current form
'If incorrect password entered give message and exit sub

If strPasswd = "XXXXX" Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

Else
MsgBox "Sorry, you do not have permission to duplicate this
profile", _
vbOKOnly, "Important Information"
Exit Sub
End If

On Error GoTo Err_DupCurrentIssue_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

Exit_DupCurrentIssue_Click:
Exit Sub

Err_DupCurrentIssue_Click:
MsgBox Err.Description
Resume Exit_DupCurrentIssue_Click
End Sub

Any help is greatly appreciated.
From: ManningFan on
I think you're going to need to post the code in
txtFindAsUTypeValue_Change in order to troubleshoot this.

Ray wrote:
> Hello and happy holidays...
>
> I have an issue i hope I can find the answer to. I have a password protected
> command button on a form that will duplicate the record when the password has
> been entered. The form then duplicates the record but the problem is an
> Unbound textbox named "txtFindAsUTypeValue" is causing Error 3020 Update of
> CancelUpdate without AddNew or Edit on txtFindAsUTypeValue_Change and i can
> not move to any other records or complete any other actions.
>
> Here is the code i am using for the commad button that duplicates the record:
>
> Private Sub DupCurrentIssue_Click()
>
> 'Attached to On Click event of DupCurrentIssue
>
> Dim strPasswd
>
> strPasswd = InputBox("Enter Password", "Restricted Form")
>
> 'Check to see if there is any entry made to input box, or if
> 'cancel button is pressed. If no entry made then exit sub.
>
> If strPasswd = "" Or strPasswd = Empty Then
> MsgBox "No Input Provided", vbInformation, "Required Data"
> Exit Sub
> End If
>
> 'If correct password is entered copy current form
> 'If incorrect password entered give message and exit sub
>
> If strPasswd = "XXXXX" Then
> DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
>
> Else
> MsgBox "Sorry, you do not have permission to duplicate this
> profile", _
> vbOKOnly, "Important Information"
> Exit Sub
> End If
>
> On Error GoTo Err_DupCurrentIssue_Click
>
>
> DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
> DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
> DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
>
> Exit_DupCurrentIssue_Click:
> Exit Sub
>
> Err_DupCurrentIssue_Click:
> MsgBox Err.Description
> Resume Exit_DupCurrentIssue_Click
> End Sub
>
> Any help is greatly appreciated.