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

Unique Tag Numbers for daily time sheets 1

Status
Not open for further replies.

LD1010

Technical User
Dec 6, 2001
78
US
Thanks for reading my post.

I need to generate daily time sheets for 3 groups (departments) of employees. I’ve created a form, frmTimeSheets the record source is qryTimeSheets that selects all active employees by department using cboDepartment on the form. There is also a calendar control on the form to select a date to be displayed on the time sheet. The output is to a report, rptTimeSheet which generates one time sheet for each employee. So the basic information that’s printed (barcode) on each sheet is EmployeeNumber, DepartmentID and LaborDate. All of this works well but I need to also print on each sheet a unique TagNumber to prevent duplicate entery when the completed time sheet are returned for posting into tblLaborHrs. (I can’t use a composite key of EmployeeNumber and Date because employees can have more than one time sheet per day.)

From reading other similar posts I understand that the only sure way to generate unique numbers is to create them in a table and then use them to generate these numbers. So I’ve created a tblTagNumbers with only two fields, TagNumberID (auto number) and TagNumber.

On a daily basis, each department prints time sheets for their employees to be included with the employee’s route sheet for the next day. How do I go about: 1, obtain a set of the tag numbers for each batch of time sheets and 2, insure that those same numbers are not used on another batch of time sheets?

Any help would be much appreciated!
 
>>I can't use a composite key of EmployeeNumber and Date because employees can have more than one time sheet per day.

The entry must be having an IN/OUT time, you can include that also in the composite key. You may need to Format the value to something like 201107130700 (yyyymmddhhnn)

I have a database monitoring payment of vehicles through an electronic gate. I have made the composite with ChipID+Registration Number+datetime(includes seconds)+ Toll gateID which is working fine.

Zameer Abdulla
 
Thanks Zameer, geat idea. I'm implementing it and I thing that solves my problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top