Sendkeys not working (1 Viewer)

Pete490h

Member
Local time
Today, 23:53
Joined
Jan 18, 2021
Messages
44
Wonder if anyone can help me with this code I have in an Event Procedure

Sendkeys “+{Right 4}, True

the shift element isn’t working as the cursor just moves right 4
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:53
Joined
Oct 29, 2018
Messages
21,496
Only one double quote?
 

Pete490h

Member
Local time
Today, 23:53
Joined
Jan 18, 2021
Messages
44
No sorry, it does have both, missed it off this message😬


Sendkeys “+{Right 4}”, True
Just changed it to uppercase….

Sendkeys “{RIGHT 4}”, False
and it worked however when I add next line of code
Sendkeys “^V”
it doesn’t 😬
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:53
Joined
Oct 29, 2018
Messages
21,496
Okay, try the following experiment. Execute your code twice in a row. What happens?

Edit: Oops, too slow. The above was in response to your previous post, before you fixed it.
 

Pete490h

Member
Local time
Today, 23:53
Joined
Jan 18, 2021
Messages
44
Okay, try the following experiment. Execute your code twice in a row. What happens?

Edit: Oops, too slow. The above was in response to your previous post, before you fixed it.
Still have the Sendkeys “^V” issue though
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:53
Joined
Oct 29, 2018
Messages
21,496
Still have the Sendkeys “^V” issue though
Not sure what to tell you. Most developers avoid or don't use Sendkeys. What are you trying to do? Maybe we can use code instead.
 

Pete490h

Member
Local time
Today, 23:53
Joined
Jan 18, 2021
Messages
44
Not sure what to tell you. Most developers avoid or don't use Sendkeys. What are you trying to do? Maybe we can use code instead.
Trying to create a copy and paste routine but make it as automated as possible….

The operator opens form NISFeatureDataFrm and selects the data rows required for copying, which is VARIABLE
They would then click a form button which copies the data (Sendkeys “^c”)then opens another form, NISFeatureDataPasteFrm
This form opens with the paste area selected (this is the Sendkeys issue) then pastes the copied data
The remaining InspectionID field will fill in with the required number
Many thanks
 

Attachments

  • 6559DFDB-2E9D-4F1C-B356-D74393920E5F.jpeg
    6559DFDB-2E9D-4F1C-B356-D74393920E5F.jpeg
    4.3 MB · Views: 89
  • 0442EE94-17DD-482A-9DFF-753AAEA95A39.jpeg
    0442EE94-17DD-482A-9DFF-753AAEA95A39.jpeg
    1.5 MB · Views: 94
  • EB5C9F28-500A-42C1-B366-E6707D3C6A26.jpeg
    EB5C9F28-500A-42C1-B366-E6707D3C6A26.jpeg
    1.7 MB · Views: 90

theDBguy

I’m here to help
Staff member
Local time
Today, 15:53
Joined
Oct 29, 2018
Messages
21,496
Trying to create a copy and paste routine but make it as automated as possible….

The operator opens form NISFeatureDataFrm and selects the data rows required for copying, which is VARIABLE
They would then click a form button which copies the data (Sendkeys “^c”)then opens another form, NISFeatureDataPasteFrm
This form opens with the paste area selected (this is the Sendkeys issue) then pastes the copied data
The remaining InspectionID field will fill in with the required number
Many thanks
Hmm, so how did Sendkeys "+{RIGHT,4}" help to do that? That code will only select 4 characters.

In any case, you might want to investigate the SelTop and SelHeight properties. You might be able to use them to determine the selected items/records.
 

Pete490h

Member
Local time
Today, 23:53
Joined
Jan 18, 2021
Messages
44
Hmm, so how did Sendkeys "+{RIGHT,4}" help to do that? That code will only select 4 characters.

In any case, you might want to investigate the SelTop and SelHeight properties. You might be able to use them to determine the selected items/records.
Sorry again, I’m going to have to get used to putting full details for you guys to help you understand
Before the Sendkeys, I told it to go to control ITEM, which then only need4 right moves😉

Do you think code could do it?

I’ve never used SelTop or SelHeight but still presume the paste issue would still apply🤔
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:53
Joined
Oct 29, 2018
Messages
21,496
Before the Sendkeys, I told it to go to control ITEM, which then only need4 right moves😉

Do you think code could do it?
Yes. For that, you could use the SelStart and SelLength properties.
 

Isaac

Lifelong Learner
Local time
Today, 15:53
Joined
Mar 14, 2017
Messages
8,778
Wonder if anyone can help me with this code I have in an Event Procedure

Sendkeys “+{Right 4}, True

the shift element isn’t working as the cursor just moves right 4

"Sendkeys Not Working"

.... that's normal.
Find another way, or disclose to any users that you don't warranty it
 

Pete490h

Member
Local time
Today, 23:53
Joined
Jan 18, 2021
Messages
44
theDBguy & Isaac,
thanks for your assistance/comments……
I have changed the form designs and put the Sendkeys within a Function (see attachment) and I’m pleased to report that it works great
The operator will be so pleased that all they have to do now is type in the inspection report they wish to copy and click a button and hey presto👍
 

Attachments

  • FB4D4D05-63CD-4399-816B-0DF999E749FD.jpeg
    FB4D4D05-63CD-4399-816B-0DF999E749FD.jpeg
    2.9 MB · Views: 127

theDBguy

I’m here to help
Staff member
Local time
Today, 15:53
Joined
Oct 29, 2018
Messages
21,496
theDBguy & Isaac,
thanks for your assistance/comments……
I have changed the form designs and put the Sendkeys within a Function (see attachment) and I’m pleased to report that it works great
The operator will be so pleased that all they have to do now is type in the inspection report they wish to copy and click a button and hey presto👍
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom