Results 1 to 4 of 4
  1. #1
    illicited is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    28

    Reference an open subform/query so its recordset can be copied into another location


    I have a continuous subform whose source is a query that data is entered into. I'd like to program a button that copies the data entered and puts it into another table. Right now I'm having problems figuring out how to reference and store the fields on that subform into a variable in VBA. I'm not sure if there is a way to reference the open recordset of the subform or the query its based on or what. Help appreciated.

    Thanks,

  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,923
    Why do you need to copy data to another table? Sounds like duplication of data.
    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
    illicited is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    28
    It's not, I just need to see an example of how to reference in VBA a subforms recordset or current field values.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,923
    Depends where the code is. Is the button on the main form or is it within the subform? You want to copy entire record(s) or just selected fields of single record?

    Does this help http://access.mvps.org/access/forms/frm0031.htm
    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.

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

Similar Threads

  1. Replies: 5
    Last Post: 08-09-2012, 12:49 PM
  2. recordset open error on SQL query
    By Siuxia in forum Programming
    Replies: 5
    Last Post: 05-30-2012, 08:02 AM
  3. Replies: 3
    Last Post: 05-09-2012, 10:53 AM
  4. Query reference to a subform
    By hawkins in forum Forms
    Replies: 3
    Last Post: 08-05-2011, 10:49 AM
  5. Replies: 1
    Last Post: 05-12-2011, 02:25 PM

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