Cascading Lists using a Query vs Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SusanK4305
    New Member
    • Sep 2010
    • 88

    #1

    Cascading Lists using a Query vs Table

    I know I have asked this once before but no one answered.
    I have 2 tables Action Type and Reason. I took those 2 and created 1 Query1 a.k.a Action Type vs Reason. Then created a Query so that the dropdowns will be in asending orde. I used fontstuff.com/access/acctut10 for help on making a Cascading Lists for Access Forms but used a query in place of a table. However all I get is numbers. What can I do to fix this? My form was created useing a table called Action Log. in it it has the following fields
    field1= SSN (this is used to make a relatioship w/ another From/based on a another table (MainDB)).
    field2= Action Type (based on the Query 1 as a lookup field)
    field3= Date
    field4= Reason (based on the Query 1 as a lookup field)
    field5= Notes

    What I uesed:
    'Placed in the After Update for Action Type
    Code:
    Private Sub [cboAction Type]_AfterUpdate()
       On Error Resume Next
       cboReason.RowSource = "Select [Action Type vs Reason].Reason " & _
                "FROM [Action Type vs Reason] " & _
                "WHERE [Action Type vs Reason].[Action Type] = '" & [cboAction Type].Value & "' " & _
                "ORDER BY [Action Type vs Reason].Reason;"
    End Sub
    Can some one see what I am doing wrong please?
    Last edited by MMcCarthy; Oct 5 '10, 04:37 AM. Reason: removing hyperlink
  • SusanK4305
    New Member
    • Sep 2010
    • 88

    #2
    Please Note the the Action Log is many Action Types w/ a Reason connected to one Main person via SSN.

    Comment

    • dsatino
      Contributor
      • May 2010
      • 393

      #3
      What do the number represent? Are they part of the query that's behind the dropbox?

      Comment

      • SusanK4305
        New Member
        • Sep 2010
        • 88

        #4
        The number represent the ID's Actions Type # are from the tblAction Type and Reason #'s are from the query.
        But I have since removed the ID's on the tblAction Type and tblReason.
        How do I create a Cascading Lists useing a Query from the begining?

        Comment

        • SusanK4305
          New Member
          • Sep 2010
          • 88

          #5
          Ok it has been 5 days. Is there a way to do this or not?

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #6
            OK Susan, to get back to your original question. The reason you were seeing numbers instead of the values is because you didn't set the width of the first column to 0 in the properties. So assuming a dropdown has two columns and you want the second column to show, in the format properties you set the column count to 2 and the column widths to 0cm;5cm I just used five as an example here.

            For a comprehensive tutorial on how cascading combo/list boxes work have a look at this insight.
            Cascading Combo/List Boxes

            Comment

            • SusanK4305
              New Member
              • Sep 2010
              • 88

              #7
              I did that along time ago. The issue is because the action types and reasons are place in a query so then set as a look up in tblAction Log.

              Comment

              • MMcCarthy
                Recognized Expert MVP
                • Aug 2006
                • 14387

                #8
                Susan

                I can't follow what you are saying. Can you attach the form and any relevent queries and tables in a database. Zip the file and then attach it.

                Mary

                Comment

                • SusanK4305
                  New Member
                  • Sep 2010
                  • 88

                  #9
                  No I can't. There is PII on it.

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32669

                    #10
                    Susan, you may need to give a fuller answer. I have no idea what you mean for instance. Instructions for attaching a database follow below :

                    When attaching your work please follow the following steps first :
                    1. Remove anything not relevant to the problem. This is not necessary in all circumstances but some databases can be very bulky and some things do not effect the actual problem at all.
                    2. Likewise, not entirely necessary in all cases, but consider saving your database in a version not later than 2003 as many of our experts don't use Access 2007. Largely they don't want to, but some also don't have access to it. Personally I will wait until I'm forced to before using it.
                    3. If the process depends on any linked tables then make local copies in your database to replace the linked tables.
                    4. If the database includes any code, ensure that all modules are set to Option Explicit (See Require Variable Declaration).
                    5. If you've done anything in steps 1 to 4 then make sure that the problem you're experiencing is still evident in the updated version.
                    6. Compile the database (From the Visual Basic Editor select Debug / Compile {Project Name}).
                    7. Compact the database (Tools / Database Utilities / Compact and Repair Database...).
                    8. Compress the database into a ZIP file.
                    9. When posting, scroll down the page and select Manage Attachments (Pressing on that leads you to a page where you can add or remove your attachments. It also lists the maximum file sizes for each of the allowed file types.) and add this new ZIP file.

                    It's also a good idea to include some instructions that enable us to find the issue you'd like help with. Maybe some instructions of what to select, click on, enter etc that ensures we'll see what you see and have the same problems.

                    Comment

                    Working...