Mainform and multiple subforms search...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #46
    OK Dan. Whenever you're ready is fine.

    Comment

    • lovelydan
      New Member
      • Mar 2009
      • 50

      #47
      NeoPa

      i finally managed to compile the DB, can i send it..

      regards, daniell

      Comment

      • lovelydan
        New Member
        • Mar 2009
        • 50

        #48
        DB attachment

        NeoPA

        there you go, i finally won my own fight...

        LovelyDan

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #49
          That's fine, but what am I looking at now? What needs resolving?

          PS. Assumed you wanted db removed after download. Let me know if not.

          Comment

          • lovelydan
            New Member
            • Mar 2009
            • 50

            #50
            NeoPa

            now whats needs resolving is a code under the combo box for By Ministry search under afterUpdate control...on frm_MainMenu..t he search for subforms..thats what was always the case here..

            after opening the db please click on the assets button on the main menu on the left then try to select a seach word from the first left combo box and observe the result. i have data on two search term "MOH and MOE" search using those from the combo box

            regards

            Comment

            • lovelydan
              New Member
              • Mar 2009
              • 50

              #51
              look at the code and c where i went wrong..

              Comment

              • lovelydan
                New Member
                • Mar 2009
                • 50

                #52
                NeoPa

                i tried all the tricks over the weekend.. did u manage to look at code...!

                Comment

                • lovelydan
                  New Member
                  • Mar 2009
                  • 50

                  #53
                  NeoPa

                  welcome back from the holiday...hope you enjoyed the rest..

                  have you look at the problem yet..?

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32633

                    #54
                    I'm sorry Dan.

                    I had a quick look but didn't get the time to look in enough detail to be of any help. I still have it to do, but can't say when I will be able to. I'll try tonight, but I'm out every evening till Thursday, so may have to wait until Friday.

                    We'll see what we can manage.

                    Comment

                    • lovelydan
                      New Member
                      • Mar 2009
                      • 50

                      #55
                      NeoPA

                      okay thanks...

                      Comment

                      • lovelydan
                        New Member
                        • Mar 2009
                        • 50

                        #56
                        NeoPA;

                        just a reminder...i know you always have your dish full..

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32633

                          #57
                          That's fine Dan.

                          I was out both of the last two evenings and didn't even get to turn on my PC.

                          I still have this thread as a saved page until I can get a chance to look it over. Bumping is not a problem though if ever you're curious to know where I'm at on it.

                          Comment

                          • NeoPa
                            Recognized Expert Moderator MVP
                            • Oct 2006
                            • 32633

                            #58
                            You have the code handling this as :
                            Code:
                            Private Sub cmbMinistryName_AfterUpdate()
                            Dim strFilter As String
                                With Me.SubForm.Form
                                ' This assumes Handle is a text field
                                strFilter = "[MinName] Like '" & Me.cmbMinistryName & "*'"
                                .Filter = strFilter
                                .FilterOn = True
                                Call .Requery
                                End With
                            End Sub
                            You could have posted this instead of the whole database as an attachment and we could have got this quicker and easier.

                            The problem is your use of Me.cmbMinistryN ame in line #5. You probably think the value will be a name ("MOE" or "MOH"), but it's actually just the [minID] field, which is numeric.

                            Look at the design of cmbMinistryName.
                            Column Count = 2 (minID & minName)
                            Column Widths = 0;2.54cm
                            Bound Column = 1

                            That last is the important one. That means the value of the ComboBox (when referred to as in Me.cmbMinistryN ame) is the minID column. So, you get 1 instead of "MOH" & 15 instead of "MOE".

                            Try instead :
                            Code:
                            Private Sub cmbMinistryName_AfterUpdate()
                            Dim strFilter As String
                                With Me.SubForm.Form
                                    ' This assumes Handle is a text field
                                    strFilter = "[MinName] Like '" & Me.cmbMinistryName.Column(1) & "*'"
                                    .Filter = strFilter
                                    .FilterOn = True
                                    'Following line not actually required after setting .Filter
                                    'Call .Requery
                                End With
                            End Sub
                            Otherwise the code looks perfect.

                            Having seen the database of course, I can say I was impressed by the design and workings of it.

                            Comment

                            • lovelydan
                              New Member
                              • Mar 2009
                              • 50

                              #59
                              eeeh. programming is not a joke neh...i have never done VB at school i just got interested and started reading books and the outcome was fruitful.

                              thanks bout the design...i was confident but now u make me feel more confident and willing to do more.

                              thanks, its working now...im glad. now i have to work on the other combo boxes...

                              regards,Lovely

                              Comment

                              • NeoPa
                                Recognized Expert Moderator MVP
                                • Oct 2006
                                • 32633

                                #60
                                I think you'll probably find they all suffer from the same misunderstandin g. They should all be easy to fix now.

                                Good luck :)

                                Comment

                                Working...