I have been struggling with this all morning, and it has got me stumped.
I have established the variable “var” and I wish to use it to replace the integer “7” at the end the following SQL statement, which is contained in a string and works as it is. However I wish to vary this integer value in the finished module
I understand that the use of quotation marks in SQL string statements is complex. I have tried various solutions I have found on the net, but they do not work. Is the parenthesis causing an added complication? :banghead:
Dim var As Integer
var = 7
‘Later in the module I have:
dbs.Execute "INSERT INTO [HeaderT] ( CardBarcode, Kiosk, KioskID )" _
& "SELECT [FixtureOrdersQ].[CardBarcode], [FixtureOrdersQ].[Kiosk], [FixtureOrdersQ].[KioskID]" _
& "FROM [FixtureOrdersQ]" _
& "GROUP BY [FixtureOrdersQ].[CardBarcode], [FixtureOrdersQ].[Kiosk], [FixtureOrdersQ].[KioskID]," _
& "[FixtureOrdersQ].[FixtureID] " _
& "HAVING ((([FixtureOrdersQ].[FixtureID])= 7));"
I have established the variable “var” and I wish to use it to replace the integer “7” at the end the following SQL statement, which is contained in a string and works as it is. However I wish to vary this integer value in the finished module
I understand that the use of quotation marks in SQL string statements is complex. I have tried various solutions I have found on the net, but they do not work. Is the parenthesis causing an added complication? :banghead:
Dim var As Integer
var = 7
‘Later in the module I have:
dbs.Execute "INSERT INTO [HeaderT] ( CardBarcode, Kiosk, KioskID )" _
& "SELECT [FixtureOrdersQ].[CardBarcode], [FixtureOrdersQ].[Kiosk], [FixtureOrdersQ].[KioskID]" _
& "FROM [FixtureOrdersQ]" _
& "GROUP BY [FixtureOrdersQ].[CardBarcode], [FixtureOrdersQ].[Kiosk], [FixtureOrdersQ].[KioskID]," _
& "[FixtureOrdersQ].[FixtureID] " _
& "HAVING ((([FixtureOrdersQ].[FixtureID])= 7));"