{Solved} - Combobox List

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Beany
    New Member
    • Nov 2006
    • 173

    #1

    {Solved} - Combobox List

    hi,

    i have got my combobox working. The combobox allows users to select a mobile phone user and it automatically populates the form with the details such as imei number, phone number, issue date etc etc.

    The details are extracted from a table called tab_main.

    The question is........ when i select a user from the combobox it shows me the details on a form on the same page. How can i show the details that appear in the form on a separate window? a window that comes over the combobox page?
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by Beany
    hi,

    i have got my combobox working. The combobox allows users to select a mobile phone user and it automatically populates the form with the details such as imei number, phone number, issue date etc etc.

    The details are extracted from a table called tab_main.

    The question is........ when i select a user from the combobox it shows me the details on a form on the same page. How can i show the details that appear in the form on a separate window? a window that comes over the combobox page?
    Assuming new form is created with tab_main as the record source.

    In the code that opens the other form change the code to:

    DoCmd.OpenForm "FormName", , , "[UserNameField]='" & Me.comboboxname & "'", , acDialog

    Comment

    • Beany
      New Member
      • Nov 2006
      • 173

      #3
      It could be a simple thing, ive used the following code in EVENT AFTER UPDATE, but it doesnt introduce a new window that shows the details once a username is selected in the combobox. What am i doing wrong? i am new to access.......
      Please explain in simple terms thanks
      -------------------------------------------------------------------------
      Option Compare Database

      Private Sub Combo24_AfterUp date()

      DoCmd.OpenForm "formtest", , , "[username]='" & Me.Combo24 & "'", , acDialog


      End Sub

      -----------------------------------------------------------------------

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Have you actually created the form "fromtest" based on the appropriate table as the record source. This code simply opens the form and filters the results. It doesn't create it.

        Originally posted by Beany
        It could be a simple thing, ive used the following code in EVENT AFTER UPDATE, but it doesnt introduce a new window that shows the details once a username is selected in the combobox. What am i doing wrong? i am new to access.......
        Please explain in simple terms thanks
        -------------------------------------------------------------------------
        Option Compare Database

        Private Sub Combo24_AfterUp date()

        DoCmd.OpenForm "formtest", , , "[username]='" & Me.Combo24 & "'", , acDialog


        End Sub

        -----------------------------------------------------------------------

        Comment

        • Beany
          New Member
          • Nov 2006
          • 173

          #5
          yes bud,

          i have created the form "formtest". In this form it has all the details extracted from the table tab_main. I have created a new form with just a combobox that allows the user to select a username. This is where im stuck, i honestly do not know what to do from here........... ...............

          im probably doing sumat wrong that it obvious but i aint pickin it up.

          If you can please provide me the full code.......... my knowledge is not at the stage of modifying yet.

          Thanku

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #6
            Originally posted by Beany
            yes bud,

            i have created the form "formtest". In this form it has all the details extracted from the table tab_main. I have created a new form with just a combobox that allows the user to select a username. This is where im stuck, i honestly do not know what to do from here........... ...............

            im probably doing sumat wrong that it obvious but i aint pickin it up.

            If you can please provide me the full code.......... my knowledge is not at the stage of modifying yet.

            Thanku
            That is the full code ...

            If you can answer these questions I will try to work out whats going on.

            1. Are you getting an error message.

            2. In the properties window of the combo box under events is [Event Procedure] showing in the After update window.

            3. In the properties what is showing under the data tab in the Row Source property and the bound column property.

            4. In the format tab what is showing in the column count property.

            Comment

            • Beany
              New Member
              • Nov 2006
              • 173

              #7
              some bloke gave me an example of a simple combobox that filters a form.

              i get the following error:

              "Syntax error (missing operator) in query expression 'username = John Pearson'."

              I get this error code no matter which name i select......

              2. In the properties window of the combo box under events the [Event Procedure] is showing

              3. In the properties under the data tab in the Row Source property, it shows table\query and the bound column property shows 1.

              4. In the format tab the column count property shows 1.

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32669

                #8
                If you're filtering by a string it must EITHER be in a variable OR surrounded by quotes.
                In your case Username = 'John Pearson'.
                BTW You've posted the value in the 'Row Source Type' property but the 'Row Source' property is the interesting one.

                Comment

                • Beany
                  New Member
                  • Nov 2006
                  • 173

                  #9
                  in the 'Row source' ive got the following SELECT [tab_main].[username] FROM tab_main;

                  is there sumat wrong with that?

                  Comment

                  • MMcCarthy
                    Recognized Expert MVP
                    • Aug 2006
                    • 14387

                    #10
                    Originally posted by Beany
                    in the 'Row source' ive got the following SELECT [tab_main].[username] FROM tab_main;

                    is there sumat wrong with that?
                    Did you copy this line in exactly as it is with the extra quotes. It shouldn't be giving you this error if it did.

                    DoCmd.OpenForm "formtest", , , "[username]='" & Me.Combo24 & "'", , acDialog

                    Comment

                    • NeoPa
                      Recognized Expert Moderator MVP
                      • Oct 2006
                      • 32669

                      #11
                      Not at all.
                      However this was not included in your previous post so MMcCarthy, would have had to request it again from you before she could help.

                      Comment

                      • Beany
                        New Member
                        • Nov 2006
                        • 173

                        #12
                        THANKYOU

                        ive got it working somehow, it took some time.....

                        thanks to every1 who replied to my post

                        Comment

                        Working...