B
Bonnie
Hi,
I have a form with a combobox control that list some sizes. They are:
12
18
20
22
I have another text box for keying a custom size, such as 12'2". What I
would like to do is have the combobox default to the next size (in this case
18). Here's the code I have used so far (it does a little more than what I
am asking for but to give an idea):
Dim MCUST As String
MCUST = Me.custwidth
If Str(Me.widthck) <> Me.custwidth Or Len(Me.custwidth) <> Len(Me.widthck)
Then
Me.widthck.Value = Int(Val(MCUST)) + 1
If InStr(Int(Me.widthck) / 2, ".") > 0 Then
Me.widthck = Me.widthck + 1
End If
If Me.widthck < 12 Then
Me.widthck = 12
End If
End If
If Len(Me.custwidth) = Len(Me.widthck) And Val(Me.custwidth) Mod 2 = 0 Then
Me.widthck = Me.custwidth
End If
Any help is appreciated.
Thanks,
Bonnie
I have a form with a combobox control that list some sizes. They are:
12
18
20
22
I have another text box for keying a custom size, such as 12'2". What I
would like to do is have the combobox default to the next size (in this case
18). Here's the code I have used so far (it does a little more than what I
am asking for but to give an idea):
Dim MCUST As String
MCUST = Me.custwidth
If Str(Me.widthck) <> Me.custwidth Or Len(Me.custwidth) <> Len(Me.widthck)
Then
Me.widthck.Value = Int(Val(MCUST)) + 1
If InStr(Int(Me.widthck) / 2, ".") > 0 Then
Me.widthck = Me.widthck + 1
End If
If Me.widthck < 12 Then
Me.widthck = 12
End If
End If
If Len(Me.custwidth) = Len(Me.widthck) And Val(Me.custwidth) Mod 2 = 0 Then
Me.widthck = Me.custwidth
End If
Any help is appreciated.
Thanks,
Bonnie