Hi,
I want to concatenate digits of 2 textboxes and 2 combo boxes in another textbox. If choose in 1st combo box (cmbstar) value=3, 2nd combo box (cmbclu) value=178 as per my coding and in textbox txthhid.text=222, txtiid.text=555 then txthhidtn.text textbox should show 10 digits like "3178222555", but it shows 9 digits like "317822255". I am totally new to this environment, looking for help
Here is the code for help:
Sub Globals
'Declare the global variables here.
Dim i,cb1,cb2
End Sub
Sub App_Start
Form1.Show
For i = 1 To 7
cmbstar.Add (i)
Next
'txthhidtn.Enabled = false
End Sub
Sub Cmbstar_SelectionChanged (Index, Value)
Select index
Case 0
cmbclu.SelectedIndex = -1
cmbclu.Clear
For i = 1 To 27
cmbclu.Add (i)
Next
Case 1
cmbclu.SelectedIndex = -1
cmbclu.Clear
For i = 1 To 14
cmbclu.Add (i)
Next
Case 2
cmbclu.SelectedIndex = -1
cmbclu.Clear
For i = 1 To 178
cmbclu.Add (i)
Next
Case 3
cmbclu.SelectedIndex = -1
cmbclu.Clear
For i = 4 To 14
cmbclu.Add (i)
Next
Case 4
cmbclu.SelectedIndex = -1
cmbclu.Clear
For i = 1 To 82
cmbclu.Add (i)
Next
Case 5
cmbclu.SelectedIndex = -1
cmbclu.Clear
For i = 5 To 58
cmbclu.Add (i)
Next
Case 6
cmbclu.SelectedIndex = -1
cmbclu.Clear
For i = 1 To 89
cmbclu.Add (i)
Next
End Select
End Sub
Sub txtiid_KeyPress (key)
If StrLength (txtiid.Text) = 2 Then
txthhidtn.SelectionLength = 10
txthhidtn.Text = cb1 & cb2 & txthhid.Text & txtiid.Text
End If
End Sub
Sub txthhid_KeyPress (key)
If StrLength (txthhid.Text) = 2 Then
txtiid.Focus
End If
End Sub
Sub Cmbstar_LostFocus
If cmbstar.SelectedIndex >= 0 Then
cb1=cmbstar.Item (cmbstar.SelectedIndex)
End If
End Sub
Sub Cmbclu_LostFocus
If cmbclu.SelectedIndex >= 0 Then
cb2=cmbclu.Item (cmbclu.SelectedIndex)
End If
End Sub