How to use a counter code (1 Viewer)

aquabp

New member
Local time
Today, 09:23
Joined
Jan 31, 2014
Messages
2
Hi, this is my first post so if it is not in the correct format please let me know.

I have just started a small business. I have a problem in the receipt DB I am hoping to get some help with. I have to track physical receipts. Currently Scanning them in does not help me.

The Receipt Table holds one receipt number per line along with other info and a PrnJr number. This PrnJr number is a page identifier and is updated to each record by the module placed in an update button. Two receipts fit on one report page. The report breaks page at this number. I physically tape the receipts to this page and put them in a book…. Accountant is happy!

The module is basically a big if than statement. So basically if a date has < 2 records assign a PrnJr Number to those two receipt records and print the report, tape the receipts onto the page, put them in the book. Using mostly an update query, it works.

The problem comes when the receipt count for the day is >2. Currently I stop the code and manually update the PrnJr Number. As we have grown there are more and more days are greater than two.

I am at a loss at how to solve this issue. From what I have researched I think I need to have a counter that counts up to two add the PrnJr number then add PrnJr+1 and add it to the next two records until all the records for that day are accounted for. All the examples I have tried that I have seen on line I have not gotten to work.

Any help or direction anyone can give me would greatly be appreciated!

This question Is about assigning a PrnJr or Journal Location ID to a record. The receipt is an actual piece of paper that you would get from any vendor, shop keeper or service provider you may purchase from. The id locates the receipt that is stored to the system and visa versa; Sorbian-Oxley stuff.

The 8x11.5 pieces of paper can hold 2 physical receipts. I need to identify them. I have a query that does that and if we only had two receipts a day I have a query that could do that, but we usually have more than that in a day. Below is an example of what the results are that I am looking for. There is a complete box in this table. Once the ID is updated to the record the record is checked as completed so the loop would be looking for the next set of two records for that day.

I just do not know how to set up an if then statement or a do loop statement that would get these results.

Date Receipt PrnJr
11/22/2015 1 JrLoc1
11/22/2015 2 JrLoc1
11/22/2015 3 JrLoc2
11/22/2015 4 JrLoc2
11/22/2015 5 JrLoc3
11/22/2015 6 JrLoc3
11/22/2015 7 JrLoc4

I need a way to identify the next records for that day that need a PrnJr Id. What do you set the counter to and how do you set up the code to loop it through to the end of the daily records?
 
Last edited:

MarkK

bit cruncher
Local time
Today, 09:23
Joined
Mar 17, 2004
Messages
8,180
If this is a problem with code, please post the code. Indicate what inputs into the code will cause it to fail, and where that failure occurs, and any error messages or other symptoms of the failure that will help us to understand the problem.

Keep in mind that we probably can't run your code without your data, so you have to tell us what happens when it runs.

Hope this helps,
 

TJPoorman

Registered User.
Local time
Today, 10:23
Joined
Jul 23, 2013
Messages
402
If you're trying to get a number result for every two records you could use a function like this:
Code:
Fix((i - 0.1) / 2) + 1

Where i is your running record count.
 

Users who are viewing this thread

Top Bottom