|
Question : Paste 7 digit number from access to IBM pcomm application.
|
|
I have an access form which has a 7 digit number field along with many others and I have code on the number field click event that will copy the fields data to the clipboard. What I need to do is have access switch to the IBM pcomm application and perform a paste from the clipboard. I will need the code to switch from access to the IBM pcomm application and paste from the clipboard.
|
|
Answer : Paste 7 digit number from access to IBM pcomm application.
|
|
For this, I suggest using the SendKeys method. Its not 100% foolproof, but works 90%-100%. On a heavy loaded PC with almost the resources used, avoid it because it will be slow and the user will 'disrupt' it eventually.
Try this code:
Dim MyAppID ' Open your pcomm application MyAppID = shell("c:\...\YourPcomm.exe") ' Activate pcomm AppActivate MyAppID ' paste SendKeys "^v"
This method requires that pcomm must be launched by your code, which may be something you don't want. In this case, you can activate using the title (generally same as the window title, or look in task list)
' Activate pcomm AppActivate "Window title of IBM Pcomm" ' paste SendKeys "^v"
This method is a bit dangerous: What if the user has two pcomm opened?
The question is now: how to get back to Access then?
AppActivate "Microsoft Access"
I suppose.
Tell me what results you have. It may a bit tedious to tune.
|
|
|
|