设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[帮助] 记录移位怎么做

[复制链接]
1#
发表于 2014-11-28 14:59:55 | 显示全部楼层
本帖最后由 todaynew 于 2014-11-28 15:02 编辑

function MoveRe(原仓库号 as string,新仓库号 as string,设备 as string,数量 as integer)
    dim ssql as string
    ssql="insert into 库存表 (仓库号,设备,数量) values ('"
    ssql=ssql & 新仓库号 & "','"
    ssql=ssql & 设备 & "',"
    ssql=ssql & 数量 & ")"
    CurrentDb.Execute ssql
   
    ssql="delete * from 库存表 where 仓库号='" & 原仓库号 & "' and 设备='" & 设备 & "'"
    CurrentDb.Execute ssql
end function

或者:

function MoveRe(原仓库号 as string,新仓库号 as string,设备 as string,数量 as integer)
    dim ssql as string
    ssql="update 库存表 set 仓库号='"  & 新仓库号 & "'"
    ssql=ssql & " where 仓库号='" & 原仓库号 & "' and 设备='" & 设备 & "'"
    CurrentDb.Execute ssql
end function


您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-21 16:19 , Processed in 0.104424 second(s), 24 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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