且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

传递SQL“喜欢”从VB代码到查询参数的字符串。

更新时间:2023-11-15 18:24:16


我有一个数据库调用FalconAnalysis.mdb。我想要使​​用的表称为通用材料。我想将值传递给的查询称为Material Query。查询中的字段称为Order_Model。我想将结果strSize从以下代码字符串传递到Material Query的Order_Model字段,该字段查看通用材料表。
I have a Database Called FalconAnalysis.mdb. The table I am wanting to use is called Generic Material. The Query I want to pass the value into is called Material Query. The field in the query is called Order_Model. I would like to pass the result, "strSize", from the following string of code into the Order_Model field of Material Query, which looks at generic Material Table.
展开 | 选择 | Wrap | 行号



看起来更像是In Construct给我:

strPassSQL =" In(& strSize&")"
Looks more like the In Construct to me:
strPassSQL = "In(" & strSize & ")"



这是进入查询还是VB代码?

Does that go into the query, or the VB code?



看起来更像是In Construct给我:

strPassSQL =" In(& strSize&")"
Looks more like the In Construct to me:
strPassSQL = "In(" & strSize & ")"



你不能将此作为查询的标准。我认为没有办法运行代码来改变查询本身的查询标准。


你很可能必须通过表格。

You can''t have this as the criteria of a query though. I don''t think there''s a way to run code which will change the criteria of a query from the query itself.

You''ll most likely have to do it through a form.