Manually update/change report's details section

G

Guest

It may be an easy one.

My report is unbounded to any queries or tables and the details are results of different queries (coming from tables created the last time the report ran) and calculated fields.

Here's an example of my report

"-Report Header-"
Report Title
"-Page Header-"
Some fixed data + Detail Title
"-Detail-"
Data coming from simple queries (return only One value) and calculated fields
"-Page Footer-"
Date + Page
"-Report Footer-"
Fixed data + calculated fields

All queries are modified in VB because the table name on which they are based may change every time. I cannot post the code I use because there is to many lines but here is what it is basically doing.

1-) Extract data from a table where date is between Date1 and Date2, where RequestType = "RFQ" and create a new table with it (Table1).
2-) From the last created table (Table1) extracts some data based on criteria: Like ‘Something’ and create a new table with it (Table2). (Something is not the real criteria) I need to do a validation check on each returned value because even if the criteria is matched it may be a wrong value.
3-) Repeat number 2 several time (actually 18 times) changing the criteria and append result to the Table2 instead of creating it.
4-) Extract data from the table2 based on new criteria and create another table with it. (Table3)
5-) Extract data from Table3 based on new criteria and create a final table with it (FinalTable)

Those operations are done in the Report_Open event.

I create 4 tables because I need results at different state in the report creation (for my calculated fields)

Now the real question, how can I tell the detail section to create a new line every time I do the above operation? Right now, if I do it 2 times the detail section will have 1 line with the results of the last time it ran.

Here is my Detail_Format section

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Call CreateTable(DateRange)
End Sub

Hoping this is enough detail.
 
M

Marshall Barton

Wow, that is a convoluted approach, but, to answer your
question, use logic along these lines:

If <there are more details to display> Then
Me.NextRecord = False
End If

at the end of your code in the Detail section's Format event
procedure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top