prints same report for all records

i have no idea what you mean about deleting posts -- i wrote that post about 5 times and every time i reloaded the screen it seemed to have dissappeared - if i was that clever i wouldnt be on the receiving end of this forum lol
anyway ive found my major fault with what was happening - the source for all the reports were frmCustomer and not frmOutstanding (this is because i also have buttons in the main form to print the reports) ive duplicated and renamed another set of reports assigned to the correct form
now all i have to do is get the loop working
 
if i was that clever i wouldnt be on the receiving end of this forum lol
You're welcome on board lol

The code I wrote for looping is correct. Like I mentioned, re-think your logic as to whether the letter to use should be based on the tick boxes or based on the due dates.
 
the letter is based on due dates - i used the code to tick the boxes as the letters are printed so they wont be mistakenly sent again but again to stop confusion ive taken that line out
what seems to be happening is that once its decided which if stateement to use for the first record - it doesnt go through the full procedure of the function -- just assumed the same if statement refers to all subsequent records
 
yes and that does the same - prints the first report for all records regardless of date
 
Remember that the DueDates for all Customers are above 20 so it will only print Letter1.
 
even when i change the dates to suit different catergories it still prints letter1 for all cases
 
thanks thats fixed it perfectly although im still not sure what you did -- i see the small module thats added - cold you please explain? also will i be able to place an if statement that will decide which case is being processed in order to tick the appropriate box automatically
thamks very much for your invaluable help
 
The DueDate field had the word "days" appended to it so it always ended up in the first Case (i.e. rptLetter1).

Change the query slightly because at the moment it's doing double calculations. Change the DueDate field to
Code:
DueDate: [DDays] & " days"
 
so if id taken out the "days" and left it as a number that would have fixed it too?

when i wrote the query i set the criteria in one line with an - and - statement but it always ended up seperated into the other columns the idea of having both criteria was supposed to stop letter2 being sent before a letter1 and letter 3 without letter1 and letter2
thanks again for your help i hope i wont be bothering you again too soon
 
Last edited:
so if id taken out the "days" and left it as a number that would have fixed it too?
If you're referring to your original code then no. In the last db I had to move a line of code a few steps up as well, i.e. the part to do with saving the ID into the public variable.
 

Users who are viewing this thread

Back
Top Bottom