UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Query By Form with Multiple Line Text Box    
 
   
allforaritz
post Jan 12 2006, 03:00 PM
Post #1

UtterAccess Member
Posts: 32



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]"

NOW:

I try to enter multiple values in the fiel "AWBS" on my form such as:

001
002
003
004

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.

Regards,
Ryan Ruetz
Go to the top of the page
 
+
fkegley
post Jan 12 2006, 03:08 PM
Post #2

UtterAccess VIP
Posts: 23,583
From: Mississippi



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.

What 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.

Or 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.
Attached File(s)
Attached File  Paraqrys.zip ( 121.26K ) Number of downloads: 11
 
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 02:59 AM