Refresh form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Umoja
    New Member
    • Nov 2006
    • 24

    #1

    Refresh form

    Hi Guys,

    I need for one of my form to refresh after a selection is made from a combo box. On my main table I have a status field which the default value is set to ‘No’. Once the selection is made from the combo box the status of the account is changed to ‘Y’. I have an update query which updates the status once the selection is made. The main source for the form is a query, in the query I have the criteria to only display ‘No’ for the status. After the selection is made I need the form to refresh. Currently I have to close the form and then reopen, then the account is no loner displayed.
    I tried to use the ‘Docmd.Requery’ to refresh the form but it did not work. Could someone please help me out, thanks for any help.
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by Umoja
    Hi Guys,

    I need for one of my form to refresh after a selection is made from a combo box. On my main table I have a status field which the default value is set to ‘No’. Once the selection is made from the combo box the status of the account is changed to ‘Y’. I have an update query which updates the status once the selection is made. The main source for the form is a query, in the query I have the criteria to only display ‘No’ for the status. After the selection is made I need the form to refresh. Currently I have to close the form and then reopen, then the account is no loner displayed.
    I tried to use the ‘Docmd.Requery’ to refresh the form but it did not work. Could someone please help me out, thanks for any help.
    Hi. Have you tried formname.Requer y

    Comment

    • nico5038
      Recognized Expert Specialist
      • Nov 2006
      • 3080

      #3
      Try in your code:
      Me.RecordSource = Me.RecordSource

      Looks odd, but requeries the form 100% sure :-)

      Nic;o)

      Comment

      • Umoja
        New Member
        • Nov 2006
        • 24

        #4
        HI guys,

        Thanks for all your help, it worked perfectly.

        Comment

        • willakawill
          Top Contributor
          • Oct 2006
          • 1646

          #5
          Originally posted by Umoja
          HI guys,

          Thanks for all your help, it worked perfectly.
          You are very welcome

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32669

            #6
            I would use
            Code:
            Me.Requery
            As Nico says the other, though it works perfectly, is not as clear for someone reading your code.

            Comment

            Working...