Hi Sara,
If you try it this way - you may have better luck
Dim strSql As String
strSql = "INSERT INTO tblPOCancels ( PONum, PODate, DateEntered,
MerchantKey,Ven dorKey, POApproved, " _
& "SuggShipDa te, Description, CostofGoods, Freight, TotalRetail,
PODatetoStores, DeptNum, Reason) " _
& "Select " & txtPOnum & ", #" & txtPODate & "#, #" & txtDateEntered &
"#, '" & txtMerchantKey & _
& "', '" & txtVendorKey & "', '" & txtApproved & "', #" &
txtShippedDate & "#, '" & txtDescription & "', " _
& txtCostOfGoods & ", " & txtFreight & ", " & txtTotalRetail & ", #" &
txtPostDateToSt ores & "#, " _
& txtDeptNum & ", '" & txtReason & "'"
DoCmd.RunSql strSql
You can place this code in a command button on the form itself. I
delimited your values as follows - number value do not require
delimiting. Date values (for Access Jet sql) require a # symbol for
delimiting - and text values (reason, Description, ...) require a single
apostrophe ' for delimiting. Also, the string above appears all jumbled
up. If you copy this into notepad to unscramble it - the strings are
all broken at _ &
the underscore defines the end of the string and the ampersand defines
the beginning of the next string. Once you clean it up - copy it into
the Form button's code module. Hopefully you wont get any red. Then it
should work.
HTH
Rich
*** Sent via Developersdex http://www.developersdex.com ***
If you try it this way - you may have better luck
Dim strSql As String
strSql = "INSERT INTO tblPOCancels ( PONum, PODate, DateEntered,
MerchantKey,Ven dorKey, POApproved, " _
& "SuggShipDa te, Description, CostofGoods, Freight, TotalRetail,
PODatetoStores, DeptNum, Reason) " _
& "Select " & txtPOnum & ", #" & txtPODate & "#, #" & txtDateEntered &
"#, '" & txtMerchantKey & _
& "', '" & txtVendorKey & "', '" & txtApproved & "', #" &
txtShippedDate & "#, '" & txtDescription & "', " _
& txtCostOfGoods & ", " & txtFreight & ", " & txtTotalRetail & ", #" &
txtPostDateToSt ores & "#, " _
& txtDeptNum & ", '" & txtReason & "'"
DoCmd.RunSql strSql
You can place this code in a command button on the form itself. I
delimited your values as follows - number value do not require
delimiting. Date values (for Access Jet sql) require a # symbol for
delimiting - and text values (reason, Description, ...) require a single
apostrophe ' for delimiting. Also, the string above appears all jumbled
up. If you copy this into notepad to unscramble it - the strings are
all broken at _ &
the underscore defines the end of the string and the ampersand defines
the beginning of the next string. Once you clean it up - copy it into
the Form button's code module. Hopefully you wont get any red. Then it
should work.
HTH
Rich
*** Sent via Developersdex http://www.developersdex.com ***
Comment