odd report problem with VBA (1 Viewer)

Lol Owen

Registered User.
Local time
Today, 08:13
Joined
Mar 15, 2004
Messages
86
Hi all, been away for some time, got a small problem and hopefully someone can send me in the right direction. I'm working on a colleagues project as part of my HND. he's asked me to look at doing an invoice system for him from his database. I've basically added a button to an existing form and used VBA to open a report template, set the recordsource of the report to a SQL statement. The SQL cross references table data to the data on the form. problem I have is: when I do this on some of the data supplied with the database it works fine. When I do it on new data that I have added, the report opens as it should but I have either 2 or 3 identical pages in the report!
The data seems fine on the whole but I just can't get my head round what's happening. I've attached the relationships table and a copy of the code I have written. I should point out I know about the poor naming conventions my colleague has used but, aside from making my job harder, it's nothing to do with me!

Cheers, Lol
 

Attachments

  • relationships.jpg
    relationships.jpg
    22.4 KB · Views: 163
  • SQL.txt
    1.6 KB · Views: 148

carash77ash

Registered User.
Local time
Today, 17:13
Joined
Jan 13, 2006
Messages
81
Sounds to me it is a problem with sort fields on report. Have a look at the way the data is being sorted in the report.

Ash
 

Lol Owen

Registered User.
Local time
Today, 08:13
Joined
Mar 15, 2004
Messages
86
Found the problem, it lay in my SQL statement. Not only did I need to match the Invoice Number on the form to the Job Details table, but also the Job Details Table Invoice No to the Invoice Table Invoice No.! It's hard working on someone else's stuff!

Cheers, Lol
 

Users who are viewing this thread

Top Bottom