cannot navigate / edit subform beyond first record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alain versa
    New Member
    • Nov 2011
    • 5

    cannot navigate / edit subform beyond first record

    I have one unbound form which contains two subforms.
    The record source of the first subform is a table containing transaction headers.
    The record source of the second subform is a table containing transaction lines.
    The link between the two tables is the Transaction identifier: relationship is one (in headers) to many (in lines)
    The selection works perfectly - it shows all lines associated with a particular header in the second subform.

    Problem: I can select and edit the first line of the second subform, but I cannot select or edit any subsequent lines although they do show up (though oddly, I can edit a boolean field in those subsequent lines). The cursor simply jumps back to the first line.
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    What version of Access are you using?

    Are these forms you have created yourself?

    Is there any code or macros behind any of the forms or controls?

    Comment

    • alain versa
      New Member
      • Nov 2011
      • 5

      #3
      Access 2003, and I did create the forms myself.
      The only code associated with this form is a Docmd.Openquery which runs an append query which adds a new transaction line for the transaction header selected if required by a user.
      These new lines then share the same Transaction identifier so they show up correctly in the transaction lines form (but as mentioned, can't navigate or edit them)

      Comment

      • alain versa
        New Member
        • Nov 2011
        • 5

        #4
        Some more information:
        If I sort the transaction line records differently in the form, I can edit the line on top.
        What it looks like doing is that it refocuses the cursor on the first line after every click in the transaction lines subform - that also explains why I can edit the Boolean (since that is one click). Is there a way around this?

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32634

          #5
          Typically (and most straightforward ly) such a scenario would be handled by a bound main form (for the headers) and an associated bound subform (for the lines). Is there any reason why you've chosen a different approach?

          Comment

          • alain versa
            New Member
            • Nov 2011
            • 5

            #6
            Reason was that I wanted to show both headers and lines as datasheets, so users can easily browse transactions, select one and then view the associated lines. Processing is not linear, user sort and filter by different criteria depending on the available source documents (screenshot attached)
            [imgnothumb]http://bytes.com/attachments/attachment/5692d1322010284/invoice-menu.jpg[/imgnothumb]
            Attached Files
            Last edited by NeoPa; Nov 23 '11, 01:19 AM. Reason: Made pic viewable.

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32634

              #7
              Is it not possible to do that the normal way? I see nothing in your explanation that indicates your chosen approach has anything to offer over the normal one :-S

              Comment

              • alain versa
                New Member
                • Nov 2011
                • 5

                #8
                Do you mean as a form + datasheet subform rather than as a form with two linked datasheet subforms? I would prefer not to as it is much easier to navigate in a datasheet given the way users interact with it in this particular business model.

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32634

                  #9
                  No. I was being dim as I haven't actually tried to work with subforms within a datasheet form before (which was what I was enquiring about). I guess it wouldn't make sense as a subform control wouldn't be shown when the form is in datasheet mode. I think that was the answer I needed from you, but never mind. Forget I asked. As I say, that's not an area I'm very familiar with.

                  Comment

                  • TheSmileyCoder
                    Recognized Expert Moderator Top Contributor
                    • Dec 2009
                    • 2322

                    #10
                    The behavior you are describing is, as far as I know, not standard. I can only guess that you have some code/macro being triggered that cause this, such as a requery.

                    It may be triggered from some sort of Got/lost focus event, or from something else. I would suggest you look over the events in your form(s), and check them for macros, or VBA code.

                    Comment

                    Working...