Hi,
I have 4 textboxes that will contain sq ft values. I want to set so that the user can enter for e.g. 12345, Once the next textbox is selected, I want to automatically change the value to 12,345.
I've tried the following
Code:
Public Sub CheckArea(Area As Integer)
If Len(Area) = 7 Then
Area = Left(Area, 1) & "," & Mid(Area, 4) & "," & Right(Area, 3)
ElseIf Len(Area) = 6 Then
new_value = Left(Area, 3) & "," & Right(Area, 3)
ElseIf Len(Area) = 5 Then
new_value = Left(Area, 2) & "," & Right(Area, 3)
End If
End Sub
Private Sub txtExistingSpace_AfterUpdate()
Call CheckArea(frmCityDev.txtExistingSpace.Text)
End Sub
But when I test it i get an Overflow error, am i on the right track or is there an easier way.
Thanks