peskywinnets
Registered User.
- Local time
- Today, 06:40
- Joined
- Feb 4, 2014
- Messages
- 576
I seek a way of selecting a table field, then having a preset autokey (shortcut key) configured, that when pressed, runs a bit of VBA, that inserts a number (1 more than the last) into the selected field.
I know how to do autokeys.
I know how to store a number, recall it, increment it, then store it away again.
What I don't know is the mechanism of getting that number out of the VBA code (a variable)& into the clipboard.
A bit of googling revealed this...
https://www.access-programmers.co.uk/forums/showthread.php?t=224088
specifically, this post...
___________________________________________
I have now got it workiny by using the following.
Quote:
Dim DataObj As New MSForms.DataObject
Dim S As String
S = Me.Stores_Address
DataObj.SetText S
DataObj.PutInClipboard
It didn't work earlier as FM20.dll was not referenced in tools / reference. As soon as I manually referenced this, it all started to work.
___________________________________________
...it's not working for me either...presumably I need to enable FM20.dll ...but I don't see it under references?
I know how to do autokeys.
I know how to store a number, recall it, increment it, then store it away again.
What I don't know is the mechanism of getting that number out of the VBA code (a variable)& into the clipboard.
A bit of googling revealed this...
https://www.access-programmers.co.uk/forums/showthread.php?t=224088
specifically, this post...
___________________________________________
I have now got it workiny by using the following.
Quote:
Dim DataObj As New MSForms.DataObject
Dim S As String
S = Me.Stores_Address
DataObj.SetText S
DataObj.PutInClipboard
It didn't work earlier as FM20.dll was not referenced in tools / reference. As soon as I manually referenced this, it all started to work.
___________________________________________
...it's not working for me either...presumably I need to enable FM20.dll ...but I don't see it under references?