Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create report from Form recordset/clone 1

Status
Not open for further replies.

fredzeppelin

Technical User
Mar 17, 2005
26
0
0
US
I have a form. It's quite complex and has multiple selection criteria. The point being, when the form is open, its recordset constitutes the universe I would like to create a report from.

The only way I've been able to succeed in this:

1. Open the form hidden ...Display "WAIT"
2. Assign a blank recordset to an empty pre-prepared temp table
3. Wade thru the form record by record
4. Append a blank recordset record, assign the appropriate form data to the new record.
5. Lather, rinse, repeat
6. Close it all
7. Open a report based on the temp table.

This seems (ahem) less than elegant.

Any recommendations, or FAQ's to point to?
(I have looked with keyword combinations of form, report and recordset.)

.....thanks, brad


A failed experiment.....
When I try to equate/assign record sets, eg.
rstemp.open "Select * From tbl"
rstemp = Me.recordsetclone

I get type mismatch errors, which my 10 pound book assures me is due to DAO/ADO mismatches, (which I'm sorry to say causes my eyes to glaze over). Its recommended fix

<dim rstemp as DAO.Recordset>

doesn't seem to work


 
You have to reference the Microsoft DAO 3.x Object Library:
when in VBE (Ctrl+G) menu Tools -> References ...

When an object is to the left of the equal sign you have to use the Set instruction:
Set rstemp = Me.RecordsetClone

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
My example left out 'set' as a typo.
I had not yet made the reference to DAO 3.6 library.

So,

Dim rsTemp as DAO.Recordset
Set rsTemp=Me.Recordsetclone

works, and I have my data universe in rsTemp

Now, How do I :
a. base a report on it? , or
b. assign/dump/link it to a table, on which I can base a report?

thanks, brad



 
I don't understand why you need a recordset.
Why not using the DoCmd.OpenReport with 4th argument set to Me.Filter ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If I don't need a recordset, that's fine.

I intend to DoCmd.OpenReport. What I don't know is how to get the data from the open form fields to the 'recordsource' of the report. When I try to design the report, I'm only permitted to use Tables or Queries as the recordsource.
I see what you mean about Me.Filter, but I'm not sure how to design the report to begin with.



Let me try again. I don't care about recordsets, etc..
I have a form that performs a number of involved calculations on multiple fields from disparate linked tables. The form is based on multiple queries to provide selection filter criteria on the full data set. All of these queries have 'run-time' selection criteria which are provided by forms opened as dialog boxes. The form shows 75 or more fields, in a multiple tabbed format, with subforms. Basically only one record is shown at a time. Controls are provided to navigate the records, and to navigate the subforms.

Now while the form is open, I'd like to create a tabular printable report of 'some' of the fields for 'all' of the filtered records.

It just seems to me, I have all the data I need in hand sorted, filtered, calculated, I'm just too ignorant to use it.

I know this is a muddle, if I knew the right terminology, etc. I'd just look it up and do it.

thanks again .....brad
 
Once I puzzled out the relationships between the report design phase, the base query and the Me.Filter, this did exactly what I needed.

Thanks muchly ....brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top