Full Version: Query By Form with Multiple Line Text Box
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
I've been scouring all over trying to find a way to use a multiple line text box to return query with ALL the criteria I want for a particular field.
I have a form: frmAWBsearch
Which has a text box named "AWBS" with the enter behavior set to "New Line in Field". I then have a command button opening my query.
On my query qryAWBsearch
Under my AWB field I entered the crieteria "[forms]![frmAWBsearch]![AWBS]"
I try to enter multiple values in the fiel "AWBS" on my form such as:
and I want the query to return the results for all those records, but it will only work if I enter one record! If I enter multiple records it comes out blank. I have been looking around and have seen that people can do this from a combo box with multiple selections, but i'm stumped as to how I could make this work.
Any help would be appreciated.
Ryan Ruetz
Yes, as you have it the entries in the text box are being picked up as ONE value. So the comparison is not being made to EACH value but to all of them considered as one value.
That you'll need to do is either use a multi-select list box, I have attached an example of how I do it, open frmListCriteria in Design View, then click the code button.
FOr you could adapt the code I am sending you to "parse" the contents of the list box into separate values, splitting them at the new line character between the values.
Access is not smart enough to do this for you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.