Hi. Just a guess, but try this:
Private Sub Paste_Bookmark_Click()
If Me.Dirty Then Me.Dirty=False
Me!hdrBookmarkLink.SetFocus
DoCmd.RunCommand acCmdPaste
End Sub
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have the following code in MS-Acces VBA, when I click on the button called Paste_Bookmark :
Private Sub Paste_Bookmark_Click()
Me!hdrBookmarkLink.SetFocus
DoCmd.RunCommand acCmdPaste
End Sub
The URL that is currently on the clipboard will be pasted in the field Me!hdrBookmarkLink.
That's ok.
But when I want to edit another field I get the message :
"Another user edited this record and saved the changes before you attempted to save your changes.
Re-edit the record."
I can avoid this if I first hit the enter key, while the focus is still on the field Me!hdrBookmarkLink.
But I would like this to happen automatically, i.e. in the coding.
I tried with : DoCmd.GotoControl "OtherField" but this fails. It gives "Run-time error 2110 : cannot move the control ..."
I just need an Enter after the Past ...
TIA
Hi. Just a guess, but try this:
Private Sub Paste_Bookmark_Click()
If Me.Dirty Then Me.Dirty=False
Me!hdrBookmarkLink.SetFocus
DoCmd.RunCommand acCmdPaste
End Sub