It worked fine for me. You said you were dealing with six digit numbers so I used 999999 and had no problems.
I do have one question though. Why is intRentalPrice (which implies integer, lng implies a Long) being set to a string? "0" is string...0 is an integer. Here is what I testedVB Code:
Private Sub Command1_Click() Dim lngRentalPrice As Long If txtRentalPrice.Text = "" Then lngRentalPrice = 0 Else lngRentalPrice = CLng(Val(txtRentalPrice.Text)) End If MsgBox lngRentalPrice End Sub




Reply With Quote