• Keep subform records visible

    Author
    Topic
    #356874

    Access 97. In a subform with 10 records, a button triggers a calculation on the current record. When this happens, the records “scroll” upward until the current record is at the top of the subform window, effectively hiding all previous records. I need to keep all the subform records visible.

    I can use the navigation buttons to move back to the first record, but if I try in code, I’m told that the form is not open. What little piece of information do I need?

    Thanks

    Viewing 1 reply thread
    Author
    Replies
    • #529011

      Post the code you’re trying to use. Someone should be able to spot the problem.

    • #529037

      I bet you are trying to address the subform directly in the Forms collection, as in “Forms!formname”, etc.

      A subform is NOT an open form! That is, it is not in Forms collection. YOu must access it via the subform control on the mainform. So it would be like this:
      Forms!MainformName!subformControlName.Form…..etc.

      • #529154

        Yes, you are right! But I still don’t understand. The subform is not an open form. As a user, I can click the navigation button in the subform that will take me to the first record. In an open form, I can ask to go to the first record via code. How do I use code to go to the first record in a subform CONTROL?

        • #529181

          I generally do it this way:
          With Forms!MainFormName!subformControlName.Form
          .recordsetclone.movefirst
          .bookmark = .recordsetclone.bookmark
          end with

    Viewing 1 reply thread
    Reply To: Keep subform records visible

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: