Results 1 to 2 of 2
  1. #1
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200

    Capturing the recordset of a subform

    When my main form loads, I run the following code (see fragment of code below). The purpose is to "capture" the recordset of the subform and set it to a DAO recordset.



    Code:
    Set rstRecord = Me.SubformName.Form.RecordsetClone
    However, sometimes it bugs out with the following error. It works most of the time, but I'm not sure what I'm doing wrong here.

    Help would be appreciated! Thanks.

    Click image for larger version. 

Name:	2-6-2013 12-17-25 PM.jpg 
Views:	9 
Size:	26.1 KB 
ID:	11073

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    I don't know why this error triggers. Nothing seems wrong about that one line of code, assuming you have a real subform name in place of SubformName.

    Did you explicitely declare the rstRecord variable as a DAO recordset object?

    Have you step debugged? You don't know what is different about the situation that triggers the error?

    Is the subform container control named different from the object it holds?

    It is possible to manipulate a form's recordsetclone without a variable object. Depends what you are doing with the recordset.
    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. form/subform ADODB recordset
    By rashima in forum Forms
    Replies: 1
    Last Post: 04-27-2012, 12:19 PM
  2. Capturing Latest Entry on Subform
    By Marie1106 in forum Forms
    Replies: 3
    Last Post: 02-21-2012, 10:40 AM
  3. caling the recordset of a subform in VBA
    By focosi in forum Forms
    Replies: 3
    Last Post: 09-27-2011, 01:07 PM
  4. Show Recordset in unbound subform
    By vgarzon in forum Forms
    Replies: 4
    Last Post: 03-02-2011, 04:11 PM
  5. Show all recordset in form/subform
    By Brian62 in forum Forms
    Replies: 4
    Last Post: 11-04-2009, 11:56 AM

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