Hi - I am attempting to use a VBA variable in my sql string to build a query. This is my syntax, but I think I have messed up where the single apostrophe goes to surround the string value that I am using for my variable. Can someone analyze and let me know here?
Code:Dim str As String str = "Select [D T].[F Name], [D T].[S N].Value, [A S].[C N] " & _ "FROM [A S] Inner Join [D T] ON ([A S].ID = [D T].[S N].Value) " & _ "AND ([A S].ID = [D T].[C N].Value) " & _ "AND [D T].[A N] '" & strValue & "'" & _ "Where (((D T].[A T]) = 99322) AND (([D T].[A S]) = 'Ready')) " & _ "Order By [D T].[A N];"