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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange and Spooky Pgm Results

Status
Not open for further replies.

Trudye

Programmer
Sep 4, 2001
932
US
Has anyone ever run a VB pgm (same data no changes to the pgm) and gotten different results?

I copied some data from my client. I ran the pgm and noticed that one person was listed twice. When I ran a query against the rpt tbl I found that there were 4 people listed twice. I looked for a common denominator but they were like 80 percent of all the other recs on the table, expect for one rec that was truly a User error. I reran the code stopping it when any of the remaining three recs was read and stepping thru the code. The pgm preformed as written, the output was perfect.

The client called me later that day to say he had encountered a new problem on the report. I ran the pgm again using the clone of his data that I had and low and behold I found the same problem.

Again I stepped thru the code and again the code performed as written. The problem disappeared again no changes to data or pgm had taken place.

I don't know how to explain this to myself let alone my client. Is this indicative of Access/VB?

Am I loosing it, or what?
Trudye
 
HI

It is difficult to comment without knowing if the report is based directly on the table or on a query.

If it is based on a table, examine the table directly to see if the repaeted lines are in fact repeated in the table. If they are not, is there any code in the report which may cause this (check in particualr OnFormat and OnPrint events).

If it is based on on a query, run the query directly WITH THE SAME CRITERIA, and see if the offending lines are repeated in the query results. If yes, your problem lies in the query. Suspect in particular any joins which may return more than one value. If the lines are not repeated in the query, then examine the report for code, as above under table.

Good Luck!
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
On Retreat will produce this. Usually it would occur with the records being at the bottom of page N and the top of page N + 1

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Thanks guys for the feedback. I solved the problem of dupe entries on the report. Ken was pointing in the right direction. The pgm processes several records for each client. In an Append query I was merging the primary input with another table. I thought that because I was requesting it be sorted by client id in the design section of the query that each client's records would sort/group togeather.

Weeeell I was wrong. The sequence was unpredictable. I had to create an additional query, a make-a-table query and request sort by client id to get the desired sequence.

Thanks again for taking the time to read my long problem and my equally long explaination.

Trudye
 
Hi

Are you aware that the Sort sequence in the report is determined by the Sorting/Group settings in the report NOT by the sequence of the underlying query?

If you are, sorry for staing the obvious, if not, well there is another little nugget of information for you.

Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Ken:

Thanks Ken I am aware of the Sorting/Grouping function associated with printing of reports.

My problem was processing records in sequence not printing. I needed to process all. Example: I needed to process all of Client ID 13092 contiguously. Thus my concern was the sequence of the input.

Trudye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top