• Copy field text to the clipboard (A97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Copy field text to the clipboard (A97)

    Author
    Topic
    #455212

    I have a main form with a command button to open a popup form, (frmRecurEntries) which contains two fields, (fldRecurTitle) and (fldRecurWords). This is a continuous form. Is it possible to select and copy all the text that is contained in the selected field where the cursor is located? By means of pressing one command button on the bottom of the form I would like to copy the field text to the clipboard and then close the popup form. The user would then be returned to the main form to paste the clipboard text as desired.

    Thank you
    Ron

    Viewing 0 reply threads
    Author
    Replies
    • #1132092

      Try this code in the On Click event of the button:

      Screen.PreviousControl.SetFocus
      RunCommand acCmdCopy

      It returns focus to the control that was active before the user clicked the button and copies its contents to the clipboard.

      • #1132101

        I receive the following error popup:
        The command or action “Copy” isn’t available now.

        *You may be in a read-only database or an unconverted database from an earlier version
        *The type of object the action applies to isn’t currently selected or isn’t in the active view

        Use only those commands and macro actions that are currently available for this database

        Thanks
        Ron

        • #1132103

          The code that I posted assumes that the user clicks in a text box, then clicks the command button.

          If it still doesn’t work then, it’s probably easier to instruct the user to select and copy (Ctrl+C) the contents himself instead of using a buttton.

          • #1132107

            I agree. A little training with the select and (Ctrl+C) is not that monumental of a task. Thanks for your help.

            Ron

    Viewing 0 reply threads
    Reply To: Copy field text to the clipboard (A97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: