Private Sub cmdDoParsing_Click()
Dim strWDH As String
Dim T As Integer
Dim intCharCollected As Integer
Dim strChar As String
Dim strNumber As String
'txtSubjectDimensions ctl has the WDH values and other characters in between
strWDH = Me.txtSubjectDimensions
For T = 1 To Len(strWDH)
strChar = Mid(strWDH, T, 1)
If Asc(strChar) >= 48 And Asc(strChar) <= 57 Then 'Numbers
strNumber = strNumber & strChar
intCharCollected = intCharCollected + 1
Else
If Right(strNumber, 1) <> "/" Then 'Add a slant between number
strNumber = strNumber & "/"
End If
End If
Next T
'----------------------------------------------------------------------------
' Example: strNumber will now be ww/ddd/h, ww/d/hhh, or whatever combination,
' but will have a slant between the three dimensions and all other characters
' will be removed
'----------------------------------------------------------------------------
'Now set the controls
Me.txtWidth = Left(strNumber, InStr(strNumber, "/") - 1) 'Set width control to width
T = Len(Left(strNumber, InStr(strNumber, "/"))) 'Locate the first /
strNumber = Right(strNumber, Len(strNumber) - T) 'Remove width and first /
Me.txtDepth = Left(strNumber, InStr(strNumber, "/") - 1) 'Set depth control to depth
T = Len(Left(strNumber, InStr(strNumber, "/"))) 'Locate the second /
strNumber = Right(strNumber, Len(strNumber) - T) 'Remove depth and second /
Me.txtHeight = strNumber 'Set Height control
End Sub