PDA

View Full Version : Run time error "13"



gmahendru
02-01-2006, 01:09 AM
Dear All,

please see the following codePrivate Sub cmdCal_Click()
If Me.TextBox10.Value = "" Then
Me.TextBox10.Value = 0
If Me.Q1.Value = "" Then
Me.Q1.Value = 0
End If

Dim i As Long
Dim a As Long

i = Me.txterate.Value
a = Me.TextBox10.Value

Select Case cbodelivery

Case Is = "Ex-works"
If cboduty = "YES" Then
Me.U1.Value = a * i * 1.38 * 1.13

Else
Me.U1.Value = a * i * 1 * 1.13
End If


End Select

Me.A1.Value = Me.U1.Value * Me.Q1.Value

End SubWhen reaching "Me.A1.Value" its giving me error RUN TIME ERROR "13"...

I figure out one thing that if i change the value of 1.38 & 1.13 to whole no it works perfectly.....

Please help me where i m wrong...


Thanks in advance.

Gautam Mahendru

Bob Phillips
02-01-2006, 02:22 AM
Waht are A1 and U1 and where are they declared?

gmahendru
02-01-2006, 04:15 AM
A1, U1 & Q1 are the listboxes in my userform... I have not declared it anywhere and when i m debuggin' my program its calculating Me.U1.Value at this line no
Me.U1.Value = a * i * 1.38 * 1.13

After End Select... it is reading Me.Q1.Value from the User Listbox but it is not multiplying the both values... I dont no why..??

matthewspatrick
02-01-2006, 06:01 AM
Two things to check:

1) Are your ListBoxes multiselect? If they are, then do not use the Value property

2) If you are assigning a value to a ListBox, make sure that the value you assign actually matches one of the ListBox items!

Patrick