I have 2 form bill.frm and add_on.frm..i want to transfer Add_On and Price to label in bill.frm(label4 and label6) but error appear(runtime error ‘13’ ,type mismatch)..what should I do then.help me?
ADD_ON.frm
-------------------------------------------------------------------------------------------------------------
Private Sub Command1_Click()
Dim Add_on As String, price As Double, total As String
If Check1.Value = 1 Then
Add_on = "Add On - Aiscream"
price = 3#
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Add_on & vbCrLf //this statement and
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf //this
End If
If Check2.Value = 1 Then
Add_on = "Add On - Dall"
price = 2.5
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Add_on & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
If Check3.Value = 1 Then
Add_on = "Add On - Papadom"
price = 1.5
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Item & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
If Check4.Value = 1 Then
Add_on = "Add On - Soda"
price = 2#
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Item & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
If Check5.Value = 1 Then
Add_on = "Add On - Sambal Belacan"
price = 2#
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Item & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
If Check6.Value = 1 Then
Add_on = "Add On - Kari"
price = 1.8
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Item & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
MsgBox total
Unload Me
End Sub
ADD_ON.frm
-------------------------------------------------------------------------------------------------------------
Private Sub Command1_Click()
Dim Add_on As String, price As Double, total As String
If Check1.Value = 1 Then
Add_on = "Add On - Aiscream"
price = 3#
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Add_on & vbCrLf //this statement and
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf //this
End If
If Check2.Value = 1 Then
Add_on = "Add On - Dall"
price = 2.5
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Add_on & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
If Check3.Value = 1 Then
Add_on = "Add On - Papadom"
price = 1.5
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Item & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
If Check4.Value = 1 Then
Add_on = "Add On - Soda"
price = 2#
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Item & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
If Check5.Value = 1 Then
Add_on = "Add On - Sambal Belacan"
price = 2#
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Item & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
If Check6.Value = 1 Then
Add_on = "Add On - Kari"
price = 1.8
total = total + price
Bill.Label4.Caption = Bill.Label4.Caption + Item & vbCrLf
Bill.Label6.Caption = Bill.Label6.Caption + total & vbCrLf
End If
MsgBox total
Unload Me
End Sub