422,023 Members | 1,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,023 IT Pros & Developers. It's quick & easy.

Numbering start with 1 each month for each Department

P: 2
I have a form name form 1 with combo box name combo1 which contain list of Departments e.g. Dept A, Dept B, Dept C etc.
And I also have table named cashbook with date, Pv no, name of beneficiary and amount

I want to start numbering from 1 each month for each department when adding new record to the table. Pv no is the field for the numbering. Please help.
2 Weeks Ago #1
Share this Question
Share on Google+
4 Replies


gnawoncents
100+
P: 205
Mafi, welcome to Bytes! We would love to guide you to a solution, but need some clarification. When are you trying to number the records? What would a sample table look like with the information filled in? Are you saying that the first day of each month, the numbering for each record for each department starts over at 1 then increments by 1 (1,2,3,...) for each additional record that month?

Help us get a better idea of what you're trying to do and we'll be glad to work with you toward a solution.
2 Weeks Ago #2

P: 2
Ok thanks for the reply

Yes I want to start the numbering first day of each month of the year, the numbering for each record for each department starts over at 1 then increments by 1 (1,2,3,...) for each additional record that month with out duplicate.

The Table name is cashbook1 and it’s format is

Date, Pv no i.e the number field, Name of Beneficiacy and Amount paid

Form1 format is

Combo1 at the form header which contain the Department list that lookup in department table

Then payment command that open payment form that I will be entering the payment detail which is a query generated from Cashbook1. Thanks
2 Weeks Ago #3

twinnyfo
Expert Mod 100+
P: 1,968
My initial thought would be that whenever you create a new record, you search to see if any records exist for the current month. If so, then the current record would have an ID which increments the count of those records by one.

Relatively simple in concept, but without greater details, this is just theory.
2 Weeks Ago #4

NeoPa
Expert Mod 15k+
P: 30,549
Try this article (Item Numbering Within a Group). It deals with exactly the sort of thing you're after I believe.
2 Weeks Ago #5

Post your reply

Sign in to post your reply or Sign up for a free account.