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 / Modules / DAO / VBA / December 2006

Tip: Looking for answers? Try searching our database.

Checking For Specific Value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alan B. Densky - 22 Dec 2006 04:08 GMT
I'm using Access 2000 with DAO.

I have a query that contains approx 50 fields for each record. I would like
to be able to check every field in the query for a value of "T"

If any field for the selected record has a value = "T" then the value of the
query is true. Otherwize it is false.

How can I loop through every field looking for the "T"?

Thanks in advance,
Alan
Allen Browne - 22 Dec 2006 04:24 GMT
You will need to generate the SQL statement that examines each field, e.g.:

   SELECT * FROM Table1
   WHERE 'T' IN ([Field1], Field2], [Field3], ... );

Almost certainly, these fields should be *records* in a related table, so
that the main record can have as many of these as apply (up to 50 related
records for each record in the main table.) With this correctly normalized
design, there would be only one fields to search.

Signature

Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I'm using Access 2000 with DAO.
>
[quoted text clipped - 10 lines]
> Thanks in advance,
> Alan
Alan B. Densky - 22 Dec 2006 05:14 GMT
Thank you!

Alan

> You will need to generate the SQL statement that examines each field, e.g.:
>
[quoted text clipped - 20 lines]
> > Thanks in advance,
> > Alan
 
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.