My Assistant
![]() ![]() |
|
|
Dec 10 2004, 05:29 AM
Post
#1
|
|
|
UtterAccess Veteran Posts: 373 From: Malaysia |
Hi, all. I was l wondering what has been wrong with below coding? It gives runtime error 3464 : Data Type Mismatch in your criteria expression on the STRSQL2 statement.
Dim strMsg As String, stDocName As String, strSQL As String, strSQL2 As String Me!DOid = Nz(DLookup("nextno", "tbl_doctype", "doctype = Forms![frm_salesDO]!frm_salesDO_detail.Form![ildct]"), 0) + 1 Me.DOid.Requery strMsg = strMsg & "New Delivery Order will be created with number ! " & DOid strMsg = strMsg & " " If MsgBox(strMsg, vbQuestion + vbYesNo, "OK?") = vbYes Then 'do nothing strSQL = "UPDATE tbl_doctype SET tbl_doctype.nextno= '" & Me.DOid & "' " & "WHERE (((tbl_doctype.doctype)='" & Forms![frm_salesDO]!frm_salesDO_detail.Form![ILDCT] & "'));" strSQL2 = " UPDATE tbl_itemledger " & _ " SET tbl_itemledger.ILDOC = ' " & Forms!frm_salesDO.[DOid] & " '," & _ " tbl_itemledger.ILstatus = '565', tbl_itemledger.ILDCT = 'h9' , " & _ " tbl_itemledger.ILQTY = 0 -' " & [ILQTYship] & " ' " & _ " WHERE tbl_itemledger.ILstatus = '560' " & _ " AND tbl_itemledger.ILDCT = 'b5' Or tbl_itemledger.ILDCT = 'b6' " & _ " AND tbl_itemledger.ilsaleno = '" & [Forms]![frm_stock control].[trno02] & " ' " & _ " Or tbl_itemledger.ilsaleno = '" & [Forms]![frm_stock control].[trno03] & " ' " & _ " AND tbl_itemledger.ildate = '" & [Forms]![frm_stock control].[shipdate] & " ' ;" CurrentDb.Execute strSQL, dbFailOnError CurrentDb.Execute strSQL2, dbFailOnError DoCmd.Close Else Me!DOid = Me.DOid.Value - 1 DoCmd.RunCommand acCmdUndo End If Hope someone could help out.. Thanks a lot,,, |
|
|
|
Dec 10 2004, 07:01 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 1,609 From: Belgium |
I think the problem comes form this :
" tbl_itemledger.ILQTY = 0 -' " & [ILQTYship] & " ' " & _ Shouldn't it be : " tbl_itemledger.ILQTY = '0 - " & [ILQTYship] & " ' " & _ or " tbl_itemledger.ILQTY = 0 - " & [ILQTYship] & _ depending on wether it's a textfield or a numercl field Remember : ' are used for assigning to textfields, for numeric fields you don't need the ' |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th June 2013 - 02:14 PM |