I'm trying to add a text string to the windows clipboard for easy copy/pasting between Access and a webpage. Seems straightforward enough but I can't find the correct reference to load the objects library in order to use the method below. Which would explain the "User-defined type not defined" error.
So, how can I tweak the code to circumvent the need to load the object database or what is the object reference called in Access 2010?
Code:
' Removes "-" from NSN string
Dim TempNSN As String
TempNSN = Me.txtNSN.Value
TempNSN = Replace(TempNSN, "-", "")
'MsgBox TempNSN 'visually ensure dashes are gone
'Saves NSN to clipboard
' http://stackoverflow.com/questions/5552299/how-to-copy-to-clipboard-using-access-vba
Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
clipboard.SetText TempNSN
clipboard.PutInClipboard
So, how can I tweak the code to circumvent the need to load the object database or what is the object reference called in Access 2010?