Filter From with Combo Box

jgelpi

New member
Local time
Today, 17:40
Joined
May 18, 2009
Messages
4
I am trying to filter out what fields the user sees on the form by using a combo box. The use selects a value in the combo box and will see only the records related to that value. I am using a SQL statement and tried the following code under the necessary field:

[Forms]![FrmDirCaseUpdate]![cmboSelect]

However, every time I try to load the form it doesn't display any records, better yet it doesn't display anything, simply a blank form, no fields, etc...I tried the same criteria using the same combo box, yet used it in a query with the same data. This worked fine and the combo box filtered out the correct records. Any suggestions? Any information will be much appreciated.
 
It would help to see the actual complete SQL statement for the query. Can yoo copy and paste the SQL for the query here?

You might also try:

Like [Forms]![FrmDirCaseUpdate]![cmboSelect]
 
Here is the full SQL Statement:

SELECT Tbl50K.CurrentBalance, Tbl50K.BegBalance, Tbl50K.Org, [tbl Organization ID].Office, Tbl50K.EntityId, Tbl50K.TP, Tbl50K.Emp, TblEmployees.LastName, TblEmployees.NickName, Tbl50K.DtAsgnd, Tbl50K.DateClosed FROM [tbl Organization ID] INNER JOIN (TblEmployees INNER JOIN Tbl50K ON TblEmployees.RACF_No = Tbl50K.Emp) ON [tbl Organization ID].Org_ID = Tbl50K.Org GROUP BY Tbl50K.CurrentBalance, Tbl50K.BegBalance, Tbl50K.Org, [tbl Organization ID].Office, Tbl50K.EntityId, Tbl50K.TP, Tbl50K.Emp, TblEmployees.LastName, TblEmployees.NickName, Tbl50K.DtAsgnd, Tbl50K.DateClosed HAVING (((Tbl50K.DateClosed) Is Null)) ORDER BY Tbl50K.BegBalance DESC;

I just need the combo box to filter out only records that match Tbl50k.Org. Thanks again for the help!
 
I do not see anywhere in the SQL where you are attempting to use the combo box as criteria. Are you applying a filter someplace else?
 
I am sorry...I gave you the working SQL statement, here is the one with the filter in it...

SELECT Tbl50K.CurrentBalance, Tbl50K.BegBalance, Tbl50K.Org, [tbl Organization ID].Office, Tbl50K.EntityId, Tbl50K.TP, Tbl50K.Emp, TblEmployees.LastName, TblEmployees.NickName, Tbl50K.DtAsgnd, Tbl50K.DateClosed FROM [tbl Organization ID] INNER JOIN (TblEmployees INNER JOIN Tbl50K ON TblEmployees.RACF_No = Tbl50K.Emp) ON [tbl Organization ID].Org_ID = Tbl50K.Org GROUP BY Tbl50K.CurrentBalance, Tbl50K.BegBalance, Tbl50K.Org, [tbl Organization ID].Office, Tbl50K.EntityId, Tbl50K.TP, Tbl50K.Emp, TblEmployees.LastName, TblEmployees.NickName, Tbl50K.DtAsgnd, Tbl50K.DateClosed HAVING (((Tbl50K.Org)=[Forms]![FrmDirCaseUpdate]![cmboSelect]) AND ((Tbl50K.DateClosed) Is Null)) ORDER BY Tbl50K.BegBalance DESC;
 

Users who are viewing this thread

Back
Top Bottom