Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2002
    Posts
    173

    Unanswered: code to update list box

    I have a list box on a access form and would like it to update everytime the focus is set to the form. What code would I need to do this?

  2. #2
    Join Date
    Sep 2001
    Posts
    46
    Can you try this and let me the result.

    Private Sub Form_Activate()
    Refresh
    End Sub

  3. #3
    Join Date
    Apr 2003
    Location
    Belgium
    Posts
    5
    I think you should just requery your listbox as the form gets the focus

  4. #4
    Join Date
    Jun 2002
    Posts
    173
    peter_2950, you're just repeating my question. Do you have a solution?

  5. #5
    Join Date
    Jun 2002
    Posts
    173
    sorry gave it a try and nothing worked

  6. #6
    Join Date
    Sep 2001
    Posts
    46
    Public Function RequeryMainSubform()
    DIm bla,..bla

    strFullSQL = "Select * From goody " & strWhereSQL

    Me!subQueryByForm.Form.RecordSource = strFullSQL

    End Function

    ==
    Where subQueryByForm is the subForm to display the data.

    Take care.
    ======
    Edmun3

  7. #7
    Join Date
    Apr 2003
    Posts
    16
    You could try Me!ListBox.Requery in the On Got Focus event of the form.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •