Advertisement

02.20.2008 at 08:01AM PST, ID: 23178009
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

show records from a combo based on another combo box

Asked by stronghold888 in Microsoft Access Database

Hi Experts,

I made some searches on EE to find the most appropiate solution, but it did not worked and I decided to ask a question. It's quite a simple question, but I haven't figured out why it does not work. I added a filter combo (fltrcboMov_value) to filter a second combo (Mov_type) that contains 3 values (Drop Writ, Polling Day, Manual).The second combo (Mov_type) comes from MovementTbl and I linked it to the main table (TblStatements).  What I wanted to do was to show records that contains these values from the second combo box.
When I run a query in the query window, it works, but when I'm trying to run the filter combo on the form, it does not work.

Any help would be great.
Here's the code in the after update of the cbofltrMov_value:

I get a Run-time error 3075 and the message that appears is "Syntax error (missing operator) in query expression StatID in (Select distinct StatementID from TblCalendar) AND cbofltrMov_value.Value = Drop Writ"Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
Private Sub cbofltrMov_value_AfterUpdate()
 
Dim a$
Dim db As DAO.Database, rst As DAO.Recordset
Dim strSQL As String
 
If cbofltrMov_value.Value = "ALL" Then
  strSQL = "TblStatements"
 
Else
  strSQL = "SELECT  *  FROM  TblStatements " & _
  " WHERE StatID in (Select distinct StatementID from TblCalendar) " & _
   " AND cbofltrMov_value.Value =" & Mov_type.Value & ""
End If
 
Set db = CurrentDb
Debug.Print strSQL
Set rst = db.OpenRecordset(strSQL)
 
If rst.RecordCount = 0 Then
    MsgBox "No unassigned calendar statements at this time"
Else
   Me.RecordSource = strSQL
End If
 
rst.Close
Set rst = Nothing
 
End Sub
[+][-]02.20.2008 at 08:06AM PST, ID: 20939052

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Access Database
Sign Up Now!
Solution Provided By: UniqueData
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.20.2008 at 08:11AM PST, ID: 20939106

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.20.2008 at 08:15AM PST, ID: 20939147

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628