Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
in VB6.0

I tried to create a unique code for each shop in the form I made. I have two TextBox controls (TBNameStore and TBCodeStore). What I want is that when I write the name of the shop, for example "Brothers in Arm", in TBNameStore, then TBCodeStore should automatically be filled with the text "BIA".

How can I do that?

TBNameStore="Brothers in Arm"
TBCodeStore="BIA"

What I have tried:

in VB6.0

I tried to create a unique code for each shop in the form I made. I have two TextBox controls (TBNameStore and TBCodeStore). What I want is that when I write the name of the shop, for example "Brothers in Arm", in TBNameStore, then TBCodeStore should automatically be filled with the text "BIA".

How can I do that?

TBNameStore="Brothers in Arm"
TBCodeStore="BIA"in VB6.0

I tried to create a unique code for each shop in the form I made. I have two TextBox controls (TBNameStore and TBCodeStore). What I want is that when I write the name of the shop, for example "Brothers in Arm", in TBNameStore, then TBCodeStore should automatically be filled with the text "BIA".

How can I do that?

TBNameStore="Brothers in Arm"
TBCodeStore="BIA"
Posted
Updated 7-Apr-21 21:43pm
Comments
Richard Deeming 8-Apr-21 4:26am    
"in VB6.0"

Why? You're using a language which has been "dead" for over 20 years! Unless you're maintaining an ancient legacy system, there's no benefit to learning VB6; use VB.NET instead.

1 solution

Take the text from your text box, and use the Split function to break it into words:
VB
Dim output() As String
output = Split("Brothers in Arm", " ")

Now you can use an array to extract the first letter of each word (since they are in separate array elements that's pretty simple) and build your output string.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900