Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Vlissingen, Netherlands
    Posts
    63
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Refresh records (2000 SR1)

    Hi All,

    I'm still having a problem after conversion of an Access 2.0 database into Access 2K
    After pushing a commandbutton on the main screen a selection has to be made using a combobox.
    When returning to the main screen the data for the selection is made will not refresh.

    I assume the problem is the vba code. As i'm not very familiar with vba code i'm asking for your assistance.

    Attached is the vba code for both forms.

    TIA
    Joop
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Refresh records (2000 SR1)

    Attaching code is a good idea, but the code for frm_LloydsVesselInformationMenu is very long. Can you tell us which procedure(s) we should look at?

  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Location
    Vlissingen, Netherlands
    Posts
    63
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Refresh records (2000 SR1)

    Apologies,

    The Commandbutton activates Private Sub ButtonShipName_Click()

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Refresh records (2000 SR1)

    The essential part seems to be

    Forms![frm_ChooseByShipName].Visible = False
    DoCmd.ApplyFilter , "[tbl_LL_ShipsInformation]![LRND] = Forms![frm_ChooseByShipName].[cb1]"
    DoCmd.Close A_FORM, "frm_ChooseByShipName"

    in the code behind frm_ChooseByShipName; these lines occur twice. I have found that ApplyFilter does not always work; setting the Filter and FilterOn properties seems to be more reliable. Additionally, I would use the reference to frm_ChooseByShipName as a literal value. Try replacing the above lines by

    Me.Visible = False
    With Forms!frm_LloydsVesselInformationMenu
    .Filter = "[tbl_LL_ShipsInformation]![LRND] = " & Chr(34) & Me.cb1 & Chr(34)
    .FilterOn = True
    End If
    DoCmd.Close acForm, Me.Name, acSaveNo

    I have assumed that cb1 contains a text value. If it is numeric, omit & Chr(34) twice. Hope this helps.

  5. #5
    Star Lounger
    Join Date
    Apr 2002
    Location
    Vlissingen, Netherlands
    Posts
    63
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Refresh records (2000 SR1)

    Thanks Hans,

    now i can continue with the remaining of the buttons.

    thanks very much,
    Joop

Posting Permissions

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