Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Automatic Numbering - HELP!

Posted on 2001-06-18
3
Medium Priority
?
175 Views
Last Modified: 2013-12-18
I have inherited a database created by someone else.  It has a reference number comprising of letters and sequential numbers.

When the user creates a new document, they are prompted on queryopen to select the document type (and therefore the letters to be used to prefix the number), this is then used to look up the next available number for that prefix (on a separate document), which is used for the reference number.  The number returned is then incremented by one and written back to the number document.

Obviously there are problems applying the number at queryopen (ie even if the document is not saved, the number still increments), however the user is experiencing erratic numbering far beyond the extent you would expect with creating and not saving documents.  Numbers are working sequentially, then suddenly jumping anything from 2 up to 60!  Does anyone have any ideas, because I've tried everything I can think of.

Deb
0
Comment
Question by:gingerdeb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6204749
You have to take a close look at the database.

Check for any hidden views or profile documents where the counter might be increased irrespective of the doc save.

As you said that the counter is generated in the queryopen, it would be appropriate if the counter is increased before save i.e in QuerySave.


If you want me to take a look at the database, you are most welcome.

Here is my Email hemanthakumark@bigfoot.com

PS: Compress the database and send it to me.

~Hemanth
0
 
LVL 6

Accepted Solution

by:
ghassan99 earned 600 total points
ID: 6205872
I had this problem before, here is how I tackled it:
I check for the last number in the view of numbers (in queryopen), retrieve it, add one to it, then show it to the user.  NOTE: I'm not adding this number to the view of numbers, or creating a doc for the new number.  When the user is ready to the save, I check this number in the querysave event to see if its still the next number in the number's view.  If it is, then I create a document and add it to the number's view.  If not, I will check what the next number is, then alert the user to the number change, and create a new document in the numbers view.  This way is 98% bullet proof (according to my OWN benchmark:).  There is no way that u will achieve 100% accuracy.
You can also check this Faq for extra info:
http://www.keysolutions.com/NotesFAQ/howdo.html

-Gus
0
 
LVL 2

Author Comment

by:gingerdeb
ID: 6240397
I'm accepting Gus' answer because it had some useful tips in it for future reference, although it didn't actually solve this particular problem.  Personally, I'm thinking user-error/ignorance is the cause of the large gaps in numbering.  The user is claiming numbers are missing, but I've been able to show her the documents with the missing numbers in another view - for some reason, she's still not convinced!  As for some of the minor gaps - I'm still not sure as the numbering was initially done via a script when old documents were imported into the database!  Anyway, there doesn't seem to be a problem any longer.

Thanks,

Deb
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question