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 / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Setting up a query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gareth Saunders - 07 Mar 2006 11:42 GMT
Hi there

I know this is a basic question, but I'm trying to design a query in a
database so that I can enter one field (for example a music cd name) and have
it display all information about the record that is searched on. So far, I've
manager to build my query but it shows the entire table. Could anybody assist
me?

Many thanks

Gareth Saunders
ex BOFH
Brendan Reynolds - 07 Mar 2006 12:12 GMT
SELECT * FROM SomeTable WHERE SomeField = [Enter text to match]

... or ...

SELECT * FROM SomeTable WHERE SomeField LIKE "*" & [Enter text to match] &
"*"

The text that you enter between the square brackets will be displayed as a
prompt to the user when the query is run.

Also take a look at the Sales by Year report in the Northwind sample
database that comes with Access, for a more sophisticated example that uses
a custom form to prompt the user for the parameters.

Signature

Brendan Reynolds
Access MVP

> Hi there
>
[quoted text clipped - 11 lines]
> Gareth Saunders
> ex BOFH
Tee See - 08 Mar 2006 00:54 GMT
Hi Brendan ... I tried your two examples below and I get them to function in
the SQL window. However when I view the output and then change to the query
grid the following is in the criteria field and produces the same output as
the SQL.

Like "*" & [Enter text to match] & "*"

Why would I need to go the SQL route?

Thanks

> SELECT * FROM SomeTable WHERE SomeField = [Enter text to match]
>
[quoted text clipped - 25 lines]
>> Gareth Saunders
>> ex BOFH
Brendan Reynolds - 08 Mar 2006 11:25 GMT
You don't. But I can't put the query design grid in a newsgroup post! :-)

It just takes a lot longer to describe how to do something using the design
grid than it does to post the SQL. So I usually post the SQL first. I'm
usually prepared to explain how to do it using the grid if asked, but I
think you know how to do that now?

Signature

Brendan Reynolds
Access MVP

> Hi Brendan ... I tried your two examples below and I get them to function
> in the SQL window. However when I view the output and then change to the
[quoted text clipped - 36 lines]
>>> Gareth Saunders
>>> ex BOFH
Tee See - 10 Mar 2006 00:09 GMT
Thank you. I just thought there might be something I was missing.

Regards

> You don't. But I can't put the query design grid in a newsgroup post! :-)
>
[quoted text clipped - 43 lines]
>>>> Gareth Saunders
>>>> ex BOFH
 
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.