Listbox - Requery

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ANDRESUK

    #1

    Listbox - Requery

    All

    I have a listbox in a form footer. When the form footer is visible the
    listbox requeries fine but when I turn the form footer visible=false
    the listbox does not requery at all. What I am trying to achieve is to
    change the listbox's rowsource, as I said this works fine when the form
    footer is visible but then nothing happens when the form footers is
    invisible. I know the rowsource is changing in the listbox but it
    doesn't requery. The funny thing is that when I try moving the
    listbox to the form details and even if the listbox in invisible all
    works fine the problem is when the listbox is in the form footer and
    the form footer is invisible.

    for reference this is the code I'm using to change the listbox's
    rowsource

    Select Case Me.txtCategory
    Case Is = 1
    Me.lstCategory. RowSource = "SQL....
    Me.lstCategory. Requery
    Case Is = 2
    Me.lstCategory. RowSource = "SQL....
    Me.lstCategory. Requery
    Case Is = 3
    Me.lstCategory. RowSource = "SQL....
    Me.lstCategory. Requery
    End Select

    Any suggestions on how I could solve this problem?
    Thanks in advanced

    GAVO.

  • ManningFan

    #2
    Re: Listbox - Requery

    What are you trying to accomplish by requerying something you can't
    see? Is the information used elsewhere? Is there a reason it needs to
    be on the form footer? There may be a more practical solution if more
    information is presented.


    ANDRESUK wrote:
    All
    >
    I have a listbox in a form footer. When the form footer is visible the
    listbox requeries fine but when I turn the form footer visible=false
    the listbox does not requery at all. What I am trying to achieve is to
    change the listbox's rowsource, as I said this works fine when the form
    footer is visible but then nothing happens when the form footers is
    invisible. I know the rowsource is changing in the listbox but it
    doesn't requery. The funny thing is that when I try moving the
    listbox to the form details and even if the listbox in invisible all
    works fine the problem is when the listbox is in the form footer and
    the form footer is invisible.
    >
    for reference this is the code I'm using to change the listbox's
    rowsource
    >
    Select Case Me.txtCategory
    Case Is = 1
    Me.lstCategory. RowSource = "SQL....
    Me.lstCategory. Requery
    Case Is = 2
    Me.lstCategory. RowSource = "SQL....
    Me.lstCategory. Requery
    Case Is = 3
    Me.lstCategory. RowSource = "SQL....
    Me.lstCategory. Requery
    End Select
    >
    Any suggestions on how I could solve this problem?
    Thanks in advanced
    >
    GAVO.

    Comment

    Working...