View Single Post
  #10  
Old January 5th, 2010, 04:47 AM posted to microsoft.public.access.forms
Pamela
external usenet poster
 
Posts: 193
Default Value Entered Isn't Valid...Error

Thanks, I'll give it a shot but I do still need the AcCmdCopy because the
user needs to paste the compiled paragraph into other (non-MS) applications.
It needs to be copied to the Clipboard not just another control in Access.

"John W. Vinson" wrote:

On Mon, 4 Jan 2010 17:49:01 -0800, Pamela
wrote:

One more question about running the compiling code from my final command
button... I was told that in order to run do the RunCommand.AcCmdCopy
function/procedure that Focus must be set to a control from which to copy the
text. Will it work w/o having a text box to which to set focus and from
which to copy it??


I've never used acCmdCopy at all, and it's certainly neither necessary nor the
best way to go.

Instead, just copy the data:

Me.targetcontrolname = Me.sourcecontrolname

or

Me.targetcontrolname = SomeVariableYouHaveSet

By using a VBA variable to hold the calculated value, you can - if you wish -
move the calculation from (possibly complicated) expressions on the Form into
your VBA code, where it can use all the power of VBA to validate, properly
handle missing information, use conditional logic (e.g. "if there is a check
in the TaxExempt checkbox use the value as is, otherwise add the tax").
--

John W. Vinson [MVP]
.