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 Programming / December 2007

Tip: Looking for answers? Try searching our database.

Filter field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Raul Sousa - 03 Dec 2007 19:49 GMT
I have a form with several fields. Two of them named Categoria and Familia.
Every Familia has one or more categoria.
I would like to show only the categoria for the selected familia.
So, I have this code to perform the selection:
SELECT Artigos.Categoria FROM Artigos WHERE (((Artigos.Familia)= [Familia]))
GROUP BY Artigos.Categoria;
It is not working. In this way it shows every categoria.

It woks if I specify the familia, like
SELECT Artigos.Categoria FROM Artigos WHERE (((Artigos.Familia)= “Livros”))
GROUP BY Artigos.Categoria;
Ofer Cohen - 03 Dec 2007 20:12 GMT
Look at this link on "Limit content of combo/list boxes"

http://www.mvps.org/access/forms/frm0028.htm

If you are using code, then you need to move the text box in the form out
side the string, like:

"SELECT Artigos.Categoria FROM Artigos WHERE (((Artigos.Familia)= " &
Me.[Familia] & ")) GROUP BY Artigos.Categoria"

Or, if you are filtering using the RowSource directly without code, you need
to provide the full path

SELECT Artigos.Categoria FROM Artigos WHERE (((Artigos.Familia)=
Forms![MainFormName]![Familia])) GROUP BY Artigos.Categoria

Signature

Good Luck
BS"D

> I have a form with several fields. Two of them named Categoria and Familia.
> Every Familia has one or more categoria.
[quoted text clipped - 7 lines]
> SELECT Artigos.Categoria FROM Artigos WHERE (((Artigos.Familia)= “Livros”))
> GROUP BY Artigos.Categoria;
Douglas J. Steele - 03 Dec 2007 20:16 GMT
SELECT Artigos.Categoria FROM Artigos
WHERE (((Artigos.Familia)= Forms![NameOfForm]![Familia]))
GROUP BY Artigos.Categoria;

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have a form with several fields. Two of them named Categoria and Familia.
> Every Familia has one or more categoria.
[quoted text clipped - 9 lines]
>  "Livros"))
> GROUP BY Artigos.Categoria;
 
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.