access| problem
Novice Access: Numbering generation issues
Description: To explain the definition and misunderstanding of the numbering in real life with a chat record
Problem:
Let me tell you something about my side. Looks like the work number 03-0756-004-1JF, said: 03 said 03 production, 0756 is the contract number, 004 represents each other unit's number, 1 indicates the contract the first several items, JF is represents the workshop. Do you think such a work number will be annoying?
Reply:
All I can say is that you have made a mistake in designing data structures.
Many programmers think "number" is a field, which is true in a computer, but, in a computer, numbering is meaningless, has no syntax, no combination, no meaning, only represents the unique identity of the record. In actual production, numbering often contains a lot of meaning (unless you use a database query system to manage random numbers). So as you said, each part of the number has meaning. Therefore, you should set up the database structure with each part as the smallest unit. Simply put, is the production date, contract number, each other unit number, the workshop is divided into several fields of storage, which can be said to be "atomic" expansion. In fact, SQL can not only query data, but also organize data, such as
Select Date & Contract number & Unit Number & Workshop as number, full name from product List
Problem:
But very miserable is: the operator has been accustomed to a very continuous input 03-0456-002-4JF such work number, told them to input separately, I am afraid it is troublesome.
Reply:
You can write code-splitting data on the Save button, even if the continuous form can write code in the BeforeUpdate event. The code can look like this:
Sub splitstring ()
Dim stra () as String
Stra () = Split (Me.textboxa, "-")
Dim I as Integer
For i = 0 to UBound (stra)
Debug.Print Stra (i)
Me ("TextBox" & i). Value=stra (i)
Next
End Sub
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service