Results 1 to 3 of 3
  1. #1
    delap009 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2013
    Posts
    1

    Wink Copy and Paste non-visable field

    Hello,



    Can you Ctrl-C a form with non-visable fields and Ctrl-V it with those field's data contained.

    I have a form with many fields, one of which I do not want users to see. I do however want the user to be able to copy the field and make a duplicate. I noticed that the data from the field's marked Visable-"No" do are not included in the copy and paste.

    Can anyone help?

    Thank you in advance

    -Zach

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You are doing copy/paste of a record? I think the question is already answered by the evidence provided.

    Will have to use different method of creating new record. If you want data carried forward to new record, one method is to set the DefaultValue property of each control that you want the data to carry forward. Use the AfterUpdate event of each control or the BeforeUpdate event of form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by June7 View Post
    You are doing copy/paste of a record?

    ...If you want data carried forward to new record, one method is to set the DefaultValue property of each control that you want the data to carry forward. Use the AfterUpdate event of each control or the BeforeUpdate event of form...
    Since the Control in question isn't Visible, one has to assume that it isn't being populated physically, i.e. through the keyboard, and so its AfterUpdate event won't be firing, so I think the second suggestion, using the Form_BeforeUpdate event, is going to have to be the way to go, with June7's approach.

    Another approach would be to have custom copy hack that

    1. Unhides the hidden Control
    2. Copies the Record
    3. Moves to a New Record
    4. Pastes the data in
    5. Re-hides the Control in question

    Something like this:
    Code:
    Private Sub cmdCopyRecord_Click()
     Me.HiddenField.Visible = True
     DoCmd.RunCommand acCmdSelectRecord
     DoCmd.RunCommand acCmdCopy
     DoCmd.GoToRecord , , acNewRec
     DoCmd.RunCommand acCmdPaste
     Me.HiddenField.Visible = False
    End Sub

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Copy and Paste Row (vb)
    By Computer202 in forum Programming
    Replies: 7
    Last Post: 03-28-2014, 01:59 AM
  2. Replies: 2
    Last Post: 03-10-2013, 01:03 AM
  3. Copy-Paste
    By BorisGomel in forum Access
    Replies: 4
    Last Post: 10-25-2011, 07:17 AM
  4. Copy / Paste some fields
    By isnpms in forum Access
    Replies: 2
    Last Post: 08-25-2010, 10:13 AM
  5. Copy / Paste some fields
    By isnpms in forum Import/Export Data
    Replies: 1
    Last Post: 08-25-2010, 07:48 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums