Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2008

Tip: Looking for answers? Try searching our database.

Select Multiple Records Within Same Field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hobbit2612 - 16 Jul 2008 21:06 GMT
Hi,

I wonder whether someone can help me please.

Through the knowledge I've gained from this and other sites I'm now able to
design a query that asks the users for parameter information to return the
desired matching records. e.g. colours that match a certain colour code or if
they choose, to view all the records by returning a null value.

Could someone perhaps offers some advice on how I may go about creating a
query where the user is asked for a parameter where the can make more than
one choice within the same field. i.e. My database has a colour code field. I
would like to allow the user to be able to select say both red and purple
records out of records that have colour codes for orange, purple, green and
red.

Any help would be greatly appreciated.

Many thanks and regards

Chris
KARL DEWEY - 16 Jul 2008 23:09 GMT
Try this --
SELECT [YourTable].*
FROM [YourTable]
WHERE ((([Enter input criteria separated by space]) Like "*" &
[YourTable].[Text field] & "*"));

Signature

KARL DEWEY
Build a little - Test a little

> Hi,
>
[quoted text clipped - 17 lines]
>
> Chris
hobbit2612 - 17 Jul 2008 20:47 GMT
Karl,

This works a treat.

Thanks very much for taking the time to reply and passing on your knowledge.

Regards

Chris

>Try this --
>SELECT [YourTable].*
[quoted text clipped - 7 lines]
>>
>> Chris
hobbit2612 - 18 Jul 2008 20:28 GMT
Karl,

As I said earlier, the code you gave me works a treat.

I've been playing around with this to try and get this to work where the user
doesn't select any criteria i.e. clicks 'Go' because they decide they want to
see all the data.

From similar posts I think that the answer may have something to do with
using the term 'Is Null', mind you I could be wrong.

I've tried adding this to various areas of the coding, but I can't quite get
this to work.

Have you any ideas please where I need to make the change.

Many thanks and regards

Chris

>Try this --
>SELECT [YourTable].*
[quoted text clipped - 7 lines]
>>
>> Chris
KARL DEWEY - 18 Jul 2008 21:12 GMT
Try this --
SELECT [YourTable].*
FROM [YourTable]
WHERE ([Enter input criteria separated by space] Like "*" &
[YourTable].[Text field] & "*") OR ([Enter input criteria separated by space]
Is Null);

Signature

KARL DEWEY
Build a little - Test a little

> Karl,
>
[quoted text clipped - 27 lines]
> >>
> >> Chris
hobbit2612 - 18 Jul 2008 21:30 GMT
Karl,

That's brilliant. I copied your code in the SQL view, obviously changing the
table and field names. I'm relatively new to Access, so I changed the view to
the design view. I was pretty close with the permetations of the coding I
tried, but I missed the crucial word 'Or'.

I really appreciate your help.

Regards

Chris

>Try this --
>SELECT [YourTable].*
[quoted text clipped - 8 lines]
>> >>
>> >> Chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.