Connecting Tech Pros Worldwide Forums | Help | Site Map

Base DS form on QueryDef?

J. Shrimp, Jr.
Guest
 
Posts: n/a
#1: Nov 13 '05
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
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Base DS form on QueryDef?



"J. Shrimp, Jr." <jumbo_shrimps@hotmail.com> wrote in message
news:110stqqt3thd89b@corp.supernews.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.StdFirstName AS FirstName, tblStudent.StdLastName AS
LastName FROM tblStudent

SELECT tblTeacher.TchFirstName AS FirstName, tblTeacher.TchLastName 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.



Closed Thread