S
Simon
What could be wrong with this, its not adding the produt to the table
Dim cmd As ADODB.Command
Dim strSQL As String
Dim strQty As String
Set cmd = New ADODB.Command
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdText
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) VALUES (Me.ProductID, me.ordernumber)"
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
End If
Dim cmd As ADODB.Command
Dim strSQL As String
Dim strQty As String
Set cmd = New ADODB.Command
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdText
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) VALUES (Me.ProductID, me.ordernumber)"
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
End If