If ListView1.SelectedItems.Count = 0 Then
            MsgBox("Plese Select a Product")
        Else
            Dim price As Double
            Dim quantity As Integer
            Dim total As Double

            price = ListView1.FocusedItem.SubItems(3).Text
            quantity = ListView1.FocusedItem.SubItems(2).Text

            If txtProductName.Text = "Happy" Then
                If txtQuantity2.Text > 20 Then
                    total = price * Val(txtQuantity2.Text) * 0.95
                    total = Format(total, "0.00")
                    execute("insert into tblOrder Values('" & txtProductName.Text & "', '" & txtQuantity2.Text & "', '" & total & "')")
                    FillListview(execute("select * from tblOrder"), ListView2)
                    MsgBox("success")
                ElseIf txtQuantity2.Text < 20 Then
                    total = price * Val(txtQuantity2.Text)
                    total = Format(total, "0.00")
                    execute("insert into tblOrder Values('" & txtProductName.Text & "', '" & txtQuantity2.Text & "', '" & total & "')")
                    FillListview(execute("select * from tblOrder"), ListView2)
                    MsgBox("success")
                    If txtProductName.Text = "Moby" Then
                        If txtQuantity2.Text > 15 Then
                            total = price * Val(txtQuantity2.Text) * 0.97
                            total = Format(total, "0.00")
                            execute("insert into tblOrder Values('" & txtProductName.Text & "', '" & txtQuantity2.Text & "', '" & total & "')")
                            FillListview(execute("select * from tblOrder"), ListView2)
                            MsgBox("success")
                        ElseIf txtQuantity.Text < 15 Then
                            total = price * Val(txtQuantity2.Text)
                            total = Format(total, "0.00")
                            execute("insert into tblOrder Values('" & txtProductName.Text & "', '" & txtQuantity2.Text & "', '" & total & "')")
                            FillListview(execute("select * from tblOrder"), ListView2)
                            MsgBox("success")
                            If txtProductName.Text = "Honey" Then
                                If txtQuantity2.Text > 25 Then
                                    total = price * Val(txtQuantity2.Text) * 0.97
                                    total = Format(total, "0.00")
                                    execute("insert into tblOrder Values('" & txtProductName.Text & "', '" & txtQuantity2.Text & "', '" & total & "')")
                                    FillListview(execute("select * from tblOrder"), ListView2)
                                    MsgBox("success")
                                ElseIf txtQuantity.Text < 25 Then
                                    total = price * Val(txtQuantity2.Text)
                                    total = Format(total, "0.00")
                                    execute("insert into tblOrder Values('" & txtProductName.Text & "', '" & txtQuantity2.Text & "', '" & total & "')")
                                    FillListview(execute("select * from tblOrder"), ListView2)
                                    MsgBox("success")

moby and Honey is not working
can you help me guys whats wrong in my code

Edited 5 Years Ago by anonimous: n/a

This question has already been answered. Start a new discussion instead.