我试图从另一个表[Process Order]中获取一条记录,并将其放入带有日期(NewTableName)的新表中,但是我一直在获取'参数太少。预期为1'。我让它工作并根据[Process No] = txtProc或更早的内容传递了一个字段,但无法使其传递我需要的所有字段。
Dim strSQL As String
Dim NewTableName As String
NewTableName = "[Process Order-Oven " & Format(Date, "DD-MM-YYYY") & "]"
strSQL = "SELECT [Run No], [Product ID], [Process No], [Product Description], " & _
"[Good Product Produced] INTO " & NewTableName & _
" FROM 'Process Order' WHERE [Process No] = txtProc.Value"
CurrentDb.Execute strSQL, dbFailOnError
[您需要连接txt值。我希望它是一个数字。如果没有,请用单引号将其引起来。
Dim strSQL As String
Dim NewTableName As String
NewTableName = "[Process Order-Oven " & Format(Date, "DD-MM-YYYY") & "]"
strSQL = "SELECT [Run No], [Product ID], [Process No], [Product Description], " & _
"[Good Product Produced] INTO " & NewTableName & _
" FROM [Process Order] WHERE [Process No] = " & txtProc
CurrentDb.Execute strSQL, dbFailOnError
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句