S
Simon
Can any one see whats wrong with this code
strQty = InputBox("How many to buy:", "Purchase Product")
If Len(strQty) > 0 Then
' confirm that valid number entered
If IsNumeric(strQty) Then
If IsNumeric(strQty) Then
strSQL = "INSERT INTO tblOrderProduct (ProductID,
OrderNumber, Qty) VALUES (Me.ProductID, 900, strQty)"
cmd.CommandText = strSQL
cmd.Execute
Else
MsgBox "Invalid quantity entered.", vbExclamation,
"Warning"
End If
Else
' user pressed Cancel button or entered no quantity in input
box
MsgBox "Purchase Cancelled.", vbInformation, "Purchase
Product"
End If
strQty = InputBox("How many to buy:", "Purchase Product")
If Len(strQty) > 0 Then
' confirm that valid number entered
If IsNumeric(strQty) Then
If IsNumeric(strQty) Then
strSQL = "INSERT INTO tblOrderProduct (ProductID,
OrderNumber, Qty) VALUES (Me.ProductID, 900, strQty)"
cmd.CommandText = strSQL
cmd.Execute
Else
MsgBox "Invalid quantity entered.", vbExclamation,
"Warning"
End If
Else
' user pressed Cancel button or entered no quantity in input
box
MsgBox "Purchase Cancelled.", vbInformation, "Purchase
Product"
End If