Recordset Problems in Report

dynamictiger

Registered User.
Local time
Today, 17:19
Joined
Feb 3, 2002
Messages
270
This is fairly complex but I will try and explain the issues.

My report is populated with unknown values right through. The only known values are in the report header after that the entire report is populated by unknown values.

What this means in practice is that I have a form which is populated by a cross tab query then converted to a data entry form. This is possible due to the form being unbound as such. That is the crosstab finds the records to record and then assigns matching values to the text boxes and so on. On printing the report the text boxes are queried to see what they contain. So far so good.

The report then looks at the values passed in and decides what they represent. For example lets say we have our form set up as follows:

Initial Val ReportedAs
txt1 Blue
txt2 Green
txt3 Red

So the report looks at the passed in value in the case of txt1 Blue and decides to run a query, or do nothing as required, to derive a message to print on the report.

To try and clarify further if we are dealing with txt1 and the value for txt1 is Blue the target for txt1 could be Red, in which case a message would be fired.

This is all possible through elaborate and extensive use of ADO and queries.

There are a limit of 8 text boxes.

The only problem with this approach is the delay in producing the report. The queries are complex and run 8 times with small deviations to return the appropriate message.

I have started to think about a super SQL. This would be a central SQL statement that is queried once and then all fields available to the report to use as required.

My problem is I do not seem to be able to get the statement to move to the next line of the recordset. I think it is firing and I think it is returning the appropriate recordset.

In simplest terms the logic looks like this:

Set global recordset
Run SQl to create Recordset
Test passed in value against target if it is lower then goto raise if it is higher then go to lower else return to start
Lower
Raise
Assign strmessage to the string to be printed
Clear the strmessage assigned, goto next record and test again
Show report on screen

Each of these steps is in a seperate module. I do not understand the following:

1: Why we can't step through the recordset
2: It seems that when we step back to the global recordset it recreates the recordset
3: I have never come across this approach I do not even know if it is feasible.
 
I think i might know your problem, (Its an access bug!!!)

your record set is stored in a global module, and all the functions around your recordset are in different modules.

this is fin in VB but access VBA is a pig and loses the reference to the records set.

i would recomend placing all your functions in a single module with the record set, this should fix the problem.





:cool:ShadeZ:cool:
 

Users who are viewing this thread

Back
Top Bottom