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

In what way is it not working?

ANONIMOUS

Try to use Elseif
for both Moby and Honey.

Let me know if it works Anonimous. Have fun!

elseif for moby and honey
doesnt work :(

whats the error?

happy is working
but moby and honey doesnt work nothing happens

help help

............

Anonimous

Try to check the END IF
for each nested IF statements.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.