Assigning VBA.SendKeys ("^v") to a variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

After you use VBA.SendKeys ("^c") to capture data in a textbox, is there a
way to assign this information to a variable?

A simple line of code strVariable = VBA.SendKeys ("^v") gets a compile error
"expected function or variable"

Thank you.
 
After you use VBA.SendKeys ("^c") to capture data in a textbox, is there a
way to assign this information to a variable?

A simple line of code strVariable = VBA.SendKeys ("^v") gets a compile error
"expected function or variable"

Thank you.

Bruce,

Take a look at using the Clipboard through code as opposed to using
the sendkeys function. Take a look at:

http://www.mvps.org/access/api/api0049.htm

While the sendkeys my seem like a good approach, actually it can have
problems. The best bet is the clipboard.

If you just need to hold on to the value of a textbox, you could just
use a variable as in:

dim strMyVal as String
strMyVal = me.NameOfTexbox

Hope this helps.

Mr. B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top