468,104 Members | 1,293 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,104 developers. It's quick & easy.

Creating a custom right-click "add then paste" item

Dear Access developers,

I have a lot of cut and pasting to do from Excel to an Access form.
But instead of just pasting, I want to "add then paste" the value.
Does anybody have a way to do this? Existing code would be
appreciated!

In other words, I'd like to right click on a form text box and add the
value stored in the clipboard to the existing value which is in the
text box.

As an example, say I have a current value of 12.2 in the text box. In
Excel, I have a value of 2.5. I'll copy the value in Excel (2.5) to
the clipboard, and then I want the "right click menu item" to add it to
the 12.2 and paste 14.7 in the text box.

The "right click menu item" could be added in Windows or strictly for
Access or a specific database, whichever is easiest. If you have some
exisiting code, please post it!

This contextual right-click menu item could be called "Add then paste".

Thanks for you help!

Nov 13 '05 #1
5 2841
dont think you an do this with simple code.

why do you want to cut it, just do the math in your head and change the
value.(if its all look like your exemple its pretty easy.)

Nov 13 '05 #2
I used easy math to illustrate my point, but I do this thousands of
times, so I can write up some VBA Access code or maybe VB.

I can't imagine the code being very complicated. Right click on the
text box, assign the value in the text box to a variable, add the last
value in the clipboard to this and return the total to the text box.

Can anybody propose a starting point with any similar right click
contextual menu?

Nov 13 '05 #3
Add and Paste wrote:
I used easy math to illustrate my point, but I do this thousands of
times, so I can write up some VBA Access code or maybe VB.

I can't imagine the code being very complicated. Right click on the
text box, assign the value in the text box to a variable, add the last
value in the clipboard to this and return the total to the text box.

Can anybody propose a starting point with any similar right click
contextual menu?


The problem is this; where is the "right-click event"? Access doesn't
support this and I can't see any API calls on the Access Web. I would be
interested if you could post back on this one, should you fine a solution.

--
Nov 13 '05 #4
Still no solution found. Does anyone have an alternate way to do this?
(see original post).

Nov 13 '05 #5
> The problem is this; where is the "right-click event"? Access doesn't
support this and I can't see any API calls on the Access Web. I would be
interested if you could post back on this one, should you fine a solution.


There is a MouseDown event.

In one of my apps I use something like:
Sub Control_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = LEFT_BUTTON Then
......
ElseIf Button = RIGHT_BUTTON Then
......
End If

--
Hope this helps
Arno R

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Josef BlŲsl | last post: by
2 posts views Thread by ssoss | last post: by
2 posts views Thread by cos75 | last post: by
1 post views Thread by dorling | last post: by
1 post views Thread by RSH | last post: by
6 posts views Thread by shapper | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.