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

santosh1

Status
Not open for further replies.

santosh1

Programmer
Apr 26, 2002
201
0
0
US
hello,

I have a customer table with 7 digit customer number field. I want to seperate this 7 digit customer number into 2 separate fields. The first 4 digit into customer list and add 0 infront of all the customer list. Then the remaining 3 digit into customer size. How can I do this ? Is it possible to create additional fields in the same table or do I have to create it in different table or which method is better? I will appreciate your help. Thanks.
 
Santosh1-

Let's say your table has the fields customer_number, customer_list, and customer_size. In your table properties, set all three of these fields to Text, and set the size of customer_number to 7, customer_list to 5, and customer_size to 3.

Now, on the form, place a text box for both customer_list and customer_size, and set their visible property to no. Now, in the events for the customer_number, put the following code in the After Update event procedure:

Code:
Me.customer_list = "0" + Left$(Me.customer_number, 4)
Me.customer_size = Right$(Me.customer_number, 3)

I think that's what you were asking.. I hope this was helpful.

-cheese
47 is a magical number. 47 plus 2 equals 49. 47 times 2 equals 94. 49 and 94. 94 and 49. Relationship between 47 and 2: it's magic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top