|
本帖最后由 真主 于 2009-11-18 16:05 编辑
- DoCmd.RunSQL "INSERT INTO A_JA_003日报录入_主表 ( 日期, 制单帐号, 所属设备ID, 锁定, 制单日志, 日报录入主表编号,开工时间, 班别, 人员01, 人员02, 人员03, 人员04, 人员05, 人员06, 人员07, 人员08, 人员09, 人员10 ) SELECT Format([Forms]![C_JA_003日报录入_电子_主表]![Text_日期],'YYYY-MM-DD') AS 日期A, [Forms]![C_JA_003日报录入_电子_主表]![ctNameID] AS 制单帐号A, [Forms]![C_JA_003日报录入_电子_主表]![Text_机台记号] AS 所属设备IDA, -1 AS 锁定A, DLookUp('UserName','B_AA_UserList','ctNameID = NameID ') & '/' & Now() AS 制单日志A, Format([Forms]![C_JA_003日报录入_电子_主表]![Text_机台记号],'0000') & '_' & Format([Forms]![C_JA_003日报录入_电子_主表]![Text_日期],'YYYYMMDD') AS 日报录入主表编号A, time() AS 开工时间A, IIf(Time()>#12/30/1899 7:30:0# And Time()<#12/30/1899 21:0:0#,1,2) AS 班别, DFirst('姓名','B_JA_000当日当班人员01') AS 人员01, DFirst('姓名','B_JA_000当日当班人员02') AS 人员02, DFirst('姓名','B_JA_000当日当班人员03') AS 人员03, DFirst('姓名','B_JA_000当日当班人员04') AS 人员04, DFirst('姓名','B_JA_000当日当班人员05') AS 人员05, DFirst('姓名','B_JA_000当日当班人员06') AS 人员06, DFirst('姓名','B_JA_000当日当班人员07') AS 人员07, DFirst('姓名','B_JA_000当日当班人员08') AS 人员08, DFirst('姓名','B_JA_000当日当班人员09') AS 人员09, DFirst('姓名','B_JA_000当日当班人员10') AS 人员10"
复制代码
-
- STemp = "INSERT INTO A_JA_003日报录入_主表"
- STemp = STemp & "( 日期, 制单帐号, 所属设备ID, 锁定, 制单日志, 日报录入主表编号,开工时间, 班别, 人员01, 人员02, 人员03, 人员04, 人员05, 人员06, 人员07, 人员08, 人员09, 人员10 )"
- STemp = STemp & " SELECT Format([Forms]![C_JA_003日报录入_电子_主表]![Text_日期],'YYYY-MM-DD') AS 日期A,"
- STemp = STemp & "[Forms]![C_JA_003日报录入_电子_主表]![ctNameID] AS 制单帐号A,"
- STemp = STemp & "[Forms]![C_JA_003日报录入_电子_主表]![Text_机台记号] AS 所属设备IDA,"
- STemp = STemp & "-1 AS 锁定A,"
- STemp = STemp & "DLookUp('UserName','B_AA_UserList','ctNameID = NameID ') & '/' & Now() AS 制单日志A,"
- STemp = STemp & "Format([Forms]![C_JA_003日报录入_电子_主表]![Text_机台记号],'0000') & '_' & Format([Forms]![C_JA_003日报录入_电子_主表]![Text_日期],'YYYYMMDD') AS 日报录入主表编号A,"
- STemp = STemp & "time() AS 开工时间A,"
- STemp = STemp & "IIf(Time()>#12/30/1899 7:30:0# And Time()<#12/30/1899 21:0:0#,1,2) AS 班别,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员01') AS 人员01,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员02') AS 人员02,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员03') AS 人员03,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员04') AS 人员04,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员05') AS 人员05,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员06') AS 人员06,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员07') AS 人员07,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员08') AS 人员08,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员09') AS 人员09,"
- STemp = STemp & "DFirst('姓名','B_JA_000当日当班人员10') AS 人员10"
- DoCmd.RunSQL STemp
复制代码 |
|