设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 944|回复: 2
打印 上一主题 下一主题

[窗体] 请看看这段代码错在哪里?谢谢

[复制链接]
跳转到指定楼层
1#
发表于 2012-3-2 16:05:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. Private Sub Receive_Status_AfterUpdate()
  2. If MsgBox("是否进行收货?", vbInformation + vbYesNo) = vbNo Then
  3. Me.Receive_Status = False
  4. Exit Sub
  5. End If

  6. Dim SQLText As String
  7. Dim Step As Integer
  8. Step = 1
  9. SQLText = "INSERT INTO [tblStockIn/Out_Remote] ([item], [Date], In_Out, [ID Motive], Quantity,Price,Total_Value)"
  10. SQLText = SQLText + "SELECT Forms![frmPurchase_Order]![SubPo].Form![item] AS [item], date(), AS [Date], 'I' AS [IN_Out], '03' AS [ID Motive], Forms![frmPurchase_Order]![SubPo].Form![Qty_receive] AS [Quantity],Forms![frmPurchase_Order]![SubPo].Form![Price] AS [Price],Forms![frmPurchase_Order]![SubPo].Form![Total_Value] AS [Total_Value] ;"
  11. DoCmd.RunSQL SQLText

  12. Step = 2
  13. SQLText = "UPDATE [tblProduct_Stock_Remote] SET [tblProduct_Stock_Remote].[Real_Qty] = Forms![frmPurchase_Order]![SubPo].Form![Qty_receive]+[tblProduct_Stock_Remote]![Real_Qty]WHERE ((([tblProduct_Stock_Remote].[ITEM])=Forms![frmPurchase_Order]![SubPo].Form![item]));"
  14. DoCmd.RunSQL SQLText

  15. Me.Receive_Status.Locked = True
  16. End Sub
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2012-3-2 16:52:33 | 只看该作者
date() AS [Date]   将,(逗号)去掉
3#
 楼主| 发表于 2012-3-2 16:59:30 | 只看该作者
风中漫步 谢谢帮助
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-12-2 03:44 , Processed in 0.085711 second(s), 27 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表