By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,704 Members | 1,867 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,704 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
Still no solution found. Does anyone have an alternate way to do this?
(see original post).

Nov 13 '05 #5

P: n/a
> 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.