How to make dropdown display updates?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Y2xhcmE=?=

    #1

    How to make dropdown display updates?

    Hi all,

    After insert an new record into database, I want to let it dsiplay the new
    added field , I repopulate the items , and call refrest, but the new item is
    still missing.

    Clara
    --
    thank you so much for your help
  • zacks@construction-imaging.com

    #2
    Re: How to make dropdown display updates?

    On Dec 14, 1:48 pm, clara <cl...@discussi ons.microsoft.c omwrote:
    Hi all,
    >
    After insert an new record into database, I want to let it dsiplay the new
    added field , I repopulate the items , and call refrest, but the new item is
    still missing.
    You;ll need to post the offending code if anyone is going to be able
    to help you. It sounds like you are doing exactly what you need to,
    although I am not sure what you mean by refresh. All you should have
    to do is clear the combobox's current list and re-add them all.

    Comment

    • =?Utf-8?B?Y2xhcmE=?=

      #3
      Re: How to make dropdown display updates?

      Could you tell me how to clear the items list?

      Clara
      --
      thank you so much for your help


      "zacks@construc tion-imaging.com" wrote:
      On Dec 14, 1:48 pm, clara <cl...@discussi ons.microsoft.c omwrote:
      Hi all,

      After insert an new record into database, I want to let it dsiplay the new
      added field , I repopulate the items , and call refrest, but the new item is
      still missing.
      >
      You;ll need to post the offending code if anyone is going to be able
      to help you. It sounds like you are doing exactly what you need to,
      although I am not sure what you mean by refresh. All you should have
      to do is clear the combobox's current list and re-add them all.
      >

      Comment

      • JDS

        #4
        Re: How to make dropdown display updates?

        On Dec 14, 6:48 pm, clara <cl...@discussi ons.microsoft.c omwrote:
        Hi all,
        >
        After insert an new record into database, I want to let it dsiplay the new
        added field , I repopulate the items , and call refrest, but the new item is
        still missing.
        >
        Clara
        --
        thank you so much for your help
        Try calling the update method. This has driven me mad in the past; you
        read the definition of the refresh method and it seems to be exactly
        what you want but does not seem to work in practice. Let us now if it
        works.

        Comment

        • =?Utf-8?B?Y2xhcmE=?=

          #5
          Re: How to make dropdown display updates?

          Hi there,

          I tried to use Refresh or Update, but they all failed. This is my code:

          Public Sub FillActID(ByRef ComboBoxEventID As ComboBox)
          Dim sqlDataReader As SqlClient.SqlDa taReader
          Dim sqlString As String = "select Event_id from Act_ID"

          sqlDataReader = CreateReader(sq lString)

          While (sqlDataReader. Read())
          ComboBoxEventID .Items.Add(CInt (sqlDataReader. Item("event_id" )))
          End While
          ComboBoxEventID .Refresh()
          ComboBoxEventID .Update()


          sqlDataReader.C lose()
          End Sub

          Clara
          thank you so much for your help


          "JDS" wrote:
          On Dec 14, 6:48 pm, clara <cl...@discussi ons.microsoft.c omwrote:
          Hi all,

          After insert an new record into database, I want to let it dsiplay the new
          added field , I repopulate the items , and call refrest, but the new item is
          still missing.

          Clara
          --
          thank you so much for your help
          >
          Try calling the update method. This has driven me mad in the past; you
          read the definition of the refresh method and it seems to be exactly
          what you want but does not seem to work in practice. Let us now if it
          works.
          >

          Comment

          Working...