Base DS form on QueryDef?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J. Shrimp, Jr.

    #1

    Base DS form on QueryDef?

    Got small tables - hundreds of 'em.
    If someone selects a table to view,
    don't wanna create a hundred forms
    Planning on creating a temp table
    and emptying, then appending data
    from selected table (there's only one field
    in all the tables and its a datasheet form).
    Will base form on that one temp table.
    Each time a new table is selected,
    the process will start again.
    Seems like many postings here are down on
    temp tables, so I was planning on trying
    using a querydef as source, but don't
    know how.


  • Stefan Kowalski

    #2
    Re: Base DS form on QueryDef?


    "J. Shrimp, Jr." <jumbo_shrimps@ hotmail.com> wrote in message
    news:110stqqt3t hd89b@corp.supe rnews.com...[color=blue]
    > Got small tables - hundreds of 'em.
    > If someone selects a table to view,
    > don't wanna create a hundred forms
    > Planning on creating a temp table
    > and emptying, then appending data
    > from selected table (there's only one field
    > in all the tables and its a datasheet form).
    > Will base form on that one temp table.
    > Each time a new table is selected,
    > the process will start again.
    > Seems like many postings here are down on
    > temp tables, so I was planning on trying
    > using a querydef as source, but don't
    > know how.[/color]

    You could try having a form with a recordsource which is sent in the
    OpenArgs when you open the form. For example, if you had two tables:
    tblStudent, tblTeacher you could have two queries:

    SELECT tblStudent.StdF irstName AS FirstName, tblStudent.StdL astName AS
    LastName FROM tblStudent

    SELECT tblTeacher.TchF irstName AS FirstName, tblTeacher.TchL astName AS
    LastName FROM tblTeacher

    Your form then has fields bound to the fields FirstName and LastName. It
    doesn't matter that neither table has the field FirstName - each query has
    an alias for this field.
    Of course, if you have hundreds of tables with datasets to be displayed in a
    similar manner, then perhaps these tables deserve to be consolidated into
    one table.



    Comment

    Working...