Hi Diana,
Probably the best way to do this is to use direct file I/O in VBA and keep the serial number in a separate file on the network. This file could contain just the last serial number issued, or could contain additional information, including a complete history of serial numbers and when they were assigned and to whom.
It works like this: when someone opens the network PR form a workbook open event macro runs code that opens the serial number file, reads the last serial number, increments it in the file and writes it to the appropriate place on the PR form, and closes the serial number file so someone else can access it. The serial number file would be locked against simultaneous access from another user for probably under 1 second, so the liklihood of a user getting a "file locked" message because another user is accessing the serial number file is pretty remote unless your organization has hundreds of people writing PRs.
You would want to think also about the possibility of a user getting a serial number assigned, but then aborting the PR form. Should the serial number be reassigned, or should it go to serial number heaven? If reassigned, then the workbook Close event should be used to undo the changes to the serial number file.
Also, for security sake, you should password-protect the code from viewing so that users are not aware that the serial number file is being accessed and what and where it is. This is to prevent mischief that could result from a user deleting or modifying the serial number file.
All of what I have described would be pretty straightforward for an experienced VBA programmer to accomplish--probably just a few hours' work.
I hope this helps.
Damon
Hi,
I have a similar situation.
If the number of people using it is small and therefore it is unlikely two people want to use it at once you can put something like:
Sheets("New Problem").Select
Range("C4").Select
ActiveCell.Value = ActiveCell.Value + 1
to increase the number in cell C4 by 1
My Macro then clears all the other input celss and save the workbook.
Regards
Lewis