Assign a TABLE as the source object of the subform

Posted on 2004-11-07
Last Modified: 2012-06-27

I have an unbound subform and the tables will be created on the fly base on the user input. How can I assign those tables as the source object of the subform by using VBA?

Thanks in advance
Question by:ishadowme
    LVL 12

    Accepted Solution

    Unless there's more to your question that it appears, you should be able to do something like this in code:
         Forms!MainFormName!SubFormName.Form.Recordsource = "TableName"

    Author Comment

    Hi Pique,

    I got it going by using this code: Forms!MainFromName.SubFormName.SourceObject = "TableName" , which is pretty close to your comment. But thanks for your quick reply. I'm sure your code will work as well.


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now