SendKey from formfield. (1 Viewer)

selvsagt

Registered User.
Local time
Today, 23:04
Joined
Jun 29, 2006
Messages
99
Hi.

I have a split DB, with frontend and backend within a citrix environment. All users work from within the citrix environment.

We have an autodialer application (outside citrix).
When i set focus to a number, and hit CTRL-ALT-SHIFT-D I automatically dial the customer. It's a nice function. However, it only works if i select the number from notepad (It does not work if i select a cell i excel this way, or in access. Why I have no idea.).

We use the accessapplication as our main system, and I would really like to implement the autodialer directly from the field "telefon".

My code so far:

Code:
Private Sub cmdDial_Click()
telefon.SetFocus
SendKeys "^%+d", True

End Sub

I assume there are som settings in access I am not aware of that prohibits this "hotkey".

Is there any way I can do this from within VBA? Add an argument to "activate" this hotkey...?
 

selvsagt

Registered User.
Local time
Today, 23:04
Joined
Jun 29, 2006
Messages
99
Update to coding.

The question remains the same, I would like to send CTRL+ALT+SHIFT+D.
I doesnt matter where I send it.

As a "quick solution" I've added a command that opens notepad, then pastes the telephone number. This works.

Now I need to "mark" the same number I've just pasted, probably with a sendkey CTRL+A, then CTRL+ALT+SHIFT+D.

The code opens notepad, and the number is added. But neither the CTRL+A or CTRL+ALT+SHIFT+D "happens".

Code:
Private Sub cmdDial_Click()


telefon.SetFocus
DoCmd.RunCommand acCmdCopy

    Shell "notepad.exe", vbNormalFocus

    Sendkeys "^V" 'This works
    Sendkeys "^A" 'Nothing happens. Missing a wait line?

    Sendkeys "^%+D" 'Nothing happens.
    
'I need function to close notepad without save prompt.


End Sub
 

selvsagt

Registered User.
Local time
Today, 23:04
Joined
Jun 29, 2006
Messages
99
Further evolvment


Code:
Private Sub cmdDial_Click()

telefon.SetFocus
DoCmd.RunCommand acCmdCopy

    Shell "notepad.exe", vbNormalFocus

    Sendkeys "^V", True     'its all good
       DoEvents
   
    Sendkeys "^a", True    'it was case sensitive. So small "a" worked.


   Sendkeys "^%+d", True 'not working. Shortcut should be CTRL+ALT+SHIFT+D
        DoEvents
        

    'Close Active window 'trenger også funksjon for å lukke notepad, ikke lagre.
    
End Sub

Still having issues.
But, the best solution would be to sendkeys directly from the form, rather than opening notepad...

Please help !
 

Users who are viewing this thread

Top Bottom