Data in a form is not refreshing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NewtoAccess
    New Member
    • May 2007
    • 32

    Data in a form is not refreshing

    Access 2003
    I have a FORM1 which I use to list inventory of devices.
    FORM1 gets its data from TABLE1.

    I have a button in Form1 which opens up FORM1EDIT - this form allows you to Add records to TABLE1.

    After succesfully adding a NEW record to TABLE1, FORM1 does not get updated.

    I added a command button to FORM1EDIT which I called "Save and Exit", at the end of the close function, I added a statement
    " DoCmd.DoMenuIte m acFormBar, acRecordsMenu, 5, , acMenuVer70"

    It doesnt refresh Form1.
    I also tried adding a command button on FORM1 to refresh, and that doesnt work either.

    Please help
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    If Form1stays open while you're entering data in Form1Edit, you need to add a line to your button on Form1 after you open Form1Edit:

    Me.Requery

    Comment

    • puppydogbuddy
      Recognized Expert Top Contributor
      • May 2007
      • 1923

      #3
      [font=Times New Roman][size=3]Replace[/size][/font]

      [size=3][font=Times New Roman] [/font][/size]

      [font=Times New Roman][size=3]DoCmd.DoMenuIte m acFormBar, acRecordsMenu, 5, , acMenuVer70[/size][/font]

      [size=3][font=Times New Roman] [/font][/size]

      [font=Times New Roman][size=3]With either:[/size][/font]

      [size=3][font=Times New Roman] [/font][/size]

      [font=Times New Roman][size=3]DoCmd.RunComman d acCmdSaveRecord[/size][/font]

      [size=3][font=Times New Roman] [/font][/size]

      [font=Times New Roman][size=3]Or[/size][/font]

      [size=3][font=Times New Roman] [/font][/size]

      [font=Times New Roman][size=3]Me.Dirty = False[/size][/font]

      [size=3][font=Times New Roman] [/font][/size]

      [font=Times New Roman][size=3]The DoMenuItem syntax was eliminated from Access versions 2000 and higher.[/size][/font]

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        Not true, PuppyDogBuddy! Syntax such as

        Code:
         DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
        is still supported in Access 2000 and is, in fact, still used for all Wizard created command buttons. Having said that, I agree it should be avoided when possible.

        Comment

        • puppydogbuddy
          Recognized Expert Top Contributor
          • May 2007
          • 1923

          #5
          Originally posted by missinglinq
          Not true, PuppyDogBuddy! Syntax such as

          Code:
           DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
          is still supported in Access 2000 and is, in fact, still used for all Wizard created command buttons. Having said that, I agree it should be avoided when possible.
          [font=Times New Roman][size=3]You are correct with regards to VBA procedures. It applies to macros (see below). Sorry for the confusion.[/size][/font]

          [size=3][font=Times New Roman] [/font][/size]

          [font=Times New Roman][size=3]From Access on-line Help:[/size][/font]

          [size=3][font=Times New Roman]The DoMenuItem Action[/font][/size]

          [font=Times New Roman][size=3]The DoMenuItem action is no longer used in Microsoft Access 2000. The new [/size][/font][font=Times New Roman][size=3][color=#0000ff]RunCommand[/color][/size][/font][size=3][font=Times New Roman] action can be used to accomplish the tasks for which you used to use the DoMenuItem action.[/font][/size]

          [font=Times New Roman][size=3]When you [/size][/font][font=Times New Roman][size=3][color=#0000ff]enable[/color][/size][/font][size=3][font=Times New Roman] a database created with a prior version of Microsoft Access, the DoMenuItem action will continue to work as it did before.[/font][/size]

          [font='Times New Roman']When you convert a database created with a prior version of Microsoft Access, all DoMenuItem actions in macros are replaced with RunCommand actions the first time that the macros are saved after conversion. DoMenuItem methods used in Visual Basic procedures aren't changed.[/font]

          Comment

          • NewtoAccess
            New Member
            • May 2007
            • 32

            #6
            Originally posted by missinglinq
            If Form1stays open while you're entering data in Form1Edit, you need to add a line to your button on Form1 after you open Form1Edit:

            Me.Requery
            That command worked. Thanks!

            Comment

            • missinglinq
              Recognized Expert Specialist
              • Nov 2006
              • 3533

              #7
              Glad we could help! ;0)>

              Comment

              Working...