N
NNlogistics
I am trying to update a query with pricing after a level of 100sq ft is
reaced on all products, I need to go back and reset pricing. So I thought I
would try to loop through the query and make changes. I am getting an error
Run-time error(2147217900) Invalid SQL statement expected
delete,insert,procedure,select,update ???
I am getting it at
rst.Open "qryTotalSquareFeet", Conn, adOpenDynamic, adLockOptimistic
although I know by now that it may not be the statement actually causing
problem.
Coding looks like
'Check if the Total sq ft of Products starting with 3 or 4 is over 100'
If Me.txtTotalSquareFeet >= 100 Then
Dim Conn As ADODB.Connection
Dim rst As ADODB.Recordset
Set Conn = New ADODB.Connection
Set rst = New ADODB.Recordset
Conn.Open CurrentProject.Connection
rst.Open "qryTotalSquareFeet", Conn, adOpenDynamic, adLockOptimistic
'qryTotalSquareFeet is looking for "Order Number" that is being
referenced on frmOrder
rst.MoveFirst
Do While Not rst.EOF
rst.edit
'Make Selling Price per unit 1.92
rst!fldProductSellingPrice = rst!fldUnitsperPerProduct * 1.92
rst.Update
'Change Extended Price
rst!fldExtendedSellingPrice = rst!fldProductSellingPrice * rst!fldQuantity
rst.Update
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
Set Conn = Nothing
End If
reaced on all products, I need to go back and reset pricing. So I thought I
would try to loop through the query and make changes. I am getting an error
Run-time error(2147217900) Invalid SQL statement expected
delete,insert,procedure,select,update ???
I am getting it at
rst.Open "qryTotalSquareFeet", Conn, adOpenDynamic, adLockOptimistic
although I know by now that it may not be the statement actually causing
problem.
Coding looks like
'Check if the Total sq ft of Products starting with 3 or 4 is over 100'
If Me.txtTotalSquareFeet >= 100 Then
Dim Conn As ADODB.Connection
Dim rst As ADODB.Recordset
Set Conn = New ADODB.Connection
Set rst = New ADODB.Recordset
Conn.Open CurrentProject.Connection
rst.Open "qryTotalSquareFeet", Conn, adOpenDynamic, adLockOptimistic
'qryTotalSquareFeet is looking for "Order Number" that is being
referenced on frmOrder
rst.MoveFirst
Do While Not rst.EOF
rst.edit
'Make Selling Price per unit 1.92
rst!fldProductSellingPrice = rst!fldUnitsperPerProduct * 1.92
rst.Update
'Change Extended Price
rst!fldExtendedSellingPrice = rst!fldProductSellingPrice * rst!fldQuantity
rst.Update
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
Set Conn = Nothing
End If