Activate textbox on mouse over, Showing linked data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daoxx
    New Member
    • Mar 2008
    • 32

    Activate textbox on mouse over, Showing linked data

    Hi

    Question#1
    Is it possible to show a textbox (linked to a field) when the mouse pointer goes over a checkbox, and hiding it when the pointer goes away, and at the same time allowing the user to handle it like a regular textbox? If so, how?

    Question#2
    What is the best way of showing data that is linked to other data?

    Example:
    Paul's ID is 1. If I select Paul in a combo box, how can I make a textbox get Paul's ID from the table People?
    If I would select another person, that person's ID would show then.


    Thank you so much.
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Originally posted by daoxx
    Question#1
    Is it possible to show a textbox (linked to a field) when the mouse pointer goes over a checkbox, and hiding it when the pointer goes away, and at the same time allowing the user to handle it like a regular textbox? If so, how?
    Using the MouseMove Property

    Originally posted by daoxx
    Question#2
    What is the best way of showing data that is linked to other data?

    Example:
    Paul's ID is 1. If I select Paul in a combo box, how can I make a textbox get Paul's ID from the table People?
    If I would select another person, that person's ID would show then.


    Thank you so much.
    You should use multicolumn combobox.
    For your particular case it will look like the following
    RowSource="SELE CT People.ID, People.Name FROM People;"
    ColumnCount=2
    BoundColumn=1
    ColumnWidths=0; 1

    Combobox will display name (2nd column), while its value saved to underlying table will be ID (1st column).

    Regards,
    Fish

    Comment

    • daoxx
      New Member
      • Mar 2008
      • 32

      #3
      Sorry for my late response, but still thank you so much, Fish!

      However, about #2, is it possible to show both fields in the combo box before clicking it?

      Thanks again

      Comment

      • FishVal
        Recognized Expert Specialist
        • Jun 2007
        • 2656

        #4
        Originally posted by daoxx
        Sorry for my late response, but still thank you so much, Fish!

        However, about #2, is it possible to show both fields in the combo box before clicking it?

        Thanks again
        Hi, daoxx.

        Sorry for delay.
        You may make both fields visible in combobox by concatenating them in RowSource query.

        Example:
        tbl.fld1 - field bound to combobox control
        tbl.fld2 - field expected to appear in combobox together with tbl.fld1 separated with " | "
        [code=sql]
        SELECT tbl.fld1, tbl.fld1 & ' | ' & tbl.fld2 AS fld12 FROM tbl;
        [/code]
        Combobox properties values are the same as in my previous post.

        Regards,
        Fish.

        Comment

        • daoxx
          New Member
          • Mar 2008
          • 32

          #5
          I didn't get it, I've tried that and it shows me the same, but the fld1 shows up twice.
          What is fld12?

          Originally posted by FishVal
          Example:
          tbl.fld1 - field bound to combobox control
          tbl.fld2 - field expected to appear in combobox together with tbl.fld1 separated with " | "
          [code=sql]
          SELECT tbl.fld1, tbl.fld1 & ' | ' & tbl.fld2 AS fld12 FROM tbl;
          [/code]

          Comment

          • FishVal
            Recognized Expert Specialist
            • Jun 2007
            • 2656

            #6
            Originally posted by daoxx
            I didn't get it, I've tried that and it shows me the same, but the fld1 shows up twice.
            Post the value of your combobox RowSource, ColumnCount, ColumnWidths and BoundColumn properties.
            What is fld12?
            [fld12] is just a name (BTW optional) to refer to the field obtained by fld1 / string constant / fld2 concatenation.

            Comment

            • daoxx
              New Member
              • Mar 2008
              • 32

              #7
              Ok, the values are:
              Code:
              RowSource="SELECT Motoristas.ID_Mot, Motoristas.Nome FROM Motoristas;"
              ColumnCount=2
              ColumnWidths=1,085cm;2,514cm
              BoundColumn=1
              PS: Please note the names are in my language so that they remain exactly the same, in case it has anything to do with the problem (Table Motoristas has ID_Mot as an ID field, and Nome as a name field).

              Originally posted by FishVal
              Post the value of your combobox RowSource, ColumnCount, ColumnWidths and BoundColumn properties.

              [fld12] is just a name (BTW optional) to refer to the field obtained by fld1 / string constant / fld2 concatenation.

              Comment

              • FishVal
                Recognized Expert Specialist
                • Jun 2007
                • 2656

                #8
                Try the following:
                Code:
                RowSource="SELECT Motoristas.ID_Mot, Motoristas.Nome & ' (ID: ' & Motoristas.ID_Mot & ')' AS txtNameAndID FROM Motoristas;"
                ColumnCount=2
                ColumnWidths=0cm;2,514cm
                BoundColumn=1
                Regards,
                Fish.

                Comment

                • daoxx
                  New Member
                  • Mar 2008
                  • 32

                  #9
                  Thanks! Works perfectly.

                  Originally posted by FishVal
                  Try the following:
                  Code:
                  RowSource="SELECT Motoristas.ID_Mot, Motoristas.Nome & ' (ID: ' & Motoristas.ID_Mot & ')' AS txtNameAndID FROM Motoristas;"
                  ColumnCount=2
                  ColumnWidths=0cm;2,514cm
                  BoundColumn=1
                  Regards,
                  Fish.

                  Comment

                  • FishVal
                    Recognized Expert Specialist
                    • Jun 2007
                    • 2656

                    #10
                    You are welcome.
                    Good luck.

                    Comment

                    Working...