I have the following code that puts a string together and throws it into a hidden textbox (txtreportcriteria) on a form (fmnubldrrebates) for me and it looks right but I don't get any records back from the query when using it. There are records to return I tried just typing in "Kent Bridell Home" in the criteria box of the query.
Dim BuilderList as String
If BuilderList <> "" Then
BuilderList = BuilderList & " or " & Chr$(34) & Me!lstBuilders.Column(0, BuilderSelected) & Chr$(34)
Else
BuilderList = Chr$(34) & Me!lstBuilders.Column(0, BuilderSelected) & Chr$(34)
End If
So the result looks something like this - "Kent Bridell Homes" or "J. A. Myers Homes" or "Cathy Calvin Homes"
And in the query I have the following in the criteria field - [forms]![fmnubldrrebates].[txtreportcriteria]
What am I doing wrong? Is this what the query is seeing - ""Kent Bridell Homes" or "J. A. Myers Homes" or "Cathy Calvin Homes"" and is confusing it? If so how do I get around this? I just need to be able to build the "or" statement on the fly and limit my query from it.
Please help,
~ Joe
Dim BuilderList as String
If BuilderList <> "" Then
BuilderList = BuilderList & " or " & Chr$(34) & Me!lstBuilders.Column(0, BuilderSelected) & Chr$(34)
Else
BuilderList = Chr$(34) & Me!lstBuilders.Column(0, BuilderSelected) & Chr$(34)
End If
So the result looks something like this - "Kent Bridell Homes" or "J. A. Myers Homes" or "Cathy Calvin Homes"
And in the query I have the following in the criteria field - [forms]![fmnubldrrebates].[txtreportcriteria]
What am I doing wrong? Is this what the query is seeing - ""Kent Bridell Homes" or "J. A. Myers Homes" or "Cathy Calvin Homes"" and is confusing it? If so how do I get around this? I just need to be able to build the "or" statement on the fly and limit my query from it.
Please help,
~ Joe