Recordset for queries

T

Tylendal

Hello...

I am working with Access 2000 and have a form that opens a number of
recordsets to test for specific conditions. Is there a way to open a query
using this recordset?

Currently the only option I have is designing a number of queries that use
the tables and parameters from the form.

Appreciate assistance on this

Fred Alyea
 
B

Bas Cost Budde

I am working with Access 2000 and have a form that opens a number of
recordsets to test for specific conditions. Is there a way to open a query
using this recordset?

What exactly should this mean? Or better, what are you trying to have
your program decide?
 
T

Tylendal

Morning...

The recordset's that are opened are based on criteria from the form they are
attached to. There are about 30 recordset's but only two are opened based on
the selected criteria. I want to open a query based on these 2 recordset's
that will supply information to a subForm where data can be modified as
needed. I can build the 30+ additional queries need to duplicate the
recordsets but I'm thinking there has to be a simpler way to use an open
recordset to create a query.

Appreciate your assistance.
 
B

Bas Cost Budde

Great! What kinds of recordset are those? Could you say that you have
different views on the same table, but with parameters?
 
T

Tylendal

The recordset's that are created are on two different tables. The parameters
for each query are the same. Employee ID, Date. I want to open a query with
each of the recordset's. I could design a query for each but since there are
like 30+ tables I want a simpler solution. I know the db.openrecordset uses
a SQL statement but I dont know how to capture that and open a query using
it. The SQL, i.e. db.openrecordset is within a Form as part of an
EventProcedure.

Appreciate your time and assistance
 
B

Bas Cost Budde

Is it that you want to open a query? For a form, you can both set the
..Recordsource property (to point to different tables) and the
..Filter/.FilterOn properties (to provide, well, filtering)

Tylendal wrote:
 
T

Tylendal

Hi...

Well what I want to do is open a form as a subForm using the recordset that
the main form creates.

The main form creates two recordset's Arst and Brst. Can I open a subForm
and have the recordsource point to the recordset created by the main form?
Not sure what the process would be for that, i.e. correct syntax

Again thanks for your help.
 
B

Bas Cost Budde

You can't open a subform. You *can* reassign its RecordSource property
on the fly, like

me!subformcontrolname.form.recordsource = yoursomething
 
T

Tylendal

Wow.... I like that idea. I will try that out tomorrow when Im at the
office. Its 7 PM here in Florida. i will let you know how it works and I
really appreciate you time and help on this. It's really appreciated.
 
D

David C. Holley

Yes it does work and I have used it quite frequently. You can even go so
far as to change the source object and display a different subform
(provided you change the master/child link fields if needed)
 
B

Bas Cost Budde

Oh, as you mention that:
I used to use a tabcontrol with several tabs with subforms. On a larger
database this became forbiddingly slow. So I pointed all subform
controls to some dummy form (loads fast) and assign the SourceObject in
the Change event of the tabcontrol (reading the required value from the
Tag property that I set for that purpose). Drawback is that you don't
have immediate subform communication ability then
 
D

David C. Holley

I believe that it is possible to have UNBOUND subform controls -
subforms not bound to specific objects.
 
T

Tylendal

Creating a vairable with the SQL statement works just fine. The form OnOpen
uses the variable to set the RecordSource. Thanks guys, appreciate you help
and input.
 
Top