Getting the right record

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John M

    Getting the right record

    Hi,

    I have a continuous form which shows a record on each line. Further details
    are available by clicking on a box which runs code to open a further form to
    give more details of the record. It works well. BUT you could well have
    your cursor on one record and click on the box for extra details of another.
    The result is that the details of the wrong record are displayed.

    To find the right record I'm using

    stLinkCriteria = "[PosId]=" & Me![PosID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    I guess I need a line of code which takes me to the relevant record where
    the text box was clicked.

    Any ideas?



  • Fletcher Arnold

    #2
    Re: Getting the right record

    "John M" <john@jmawer.de mon.co.uk> wrote in message
    news:c1756s$hsj $1$8302bc10@new s.demon.co.uk.. .[color=blue]
    > Hi,
    >
    > I have a continuous form which shows a record on each line. Further[/color]
    details[color=blue]
    > are available by clicking on a box which runs code to open a further form[/color]
    to[color=blue]
    > give more details of the record. It works well. BUT you could well have
    > your cursor on one record and click on the box for extra details of[/color]
    another.[color=blue]
    > The result is that the details of the wrong record are displayed.
    >
    > To find the right record I'm using
    >
    > stLinkCriteria = "[PosId]=" & Me![PosID]
    > DoCmd.OpenForm stDocName, , , stLinkCriteria
    >
    > I guess I need a line of code which takes me to the relevant record where
    > the text box was clicked.
    >
    > Any ideas?[/color]


    [color=blue]
    >Further details are available by clicking on a box ...[/color]

    What is this 'box'? If you put the code, say, in the double-click event of
    a texbox on the continuous form, you could guarantee getting the right
    record.


    Fletcher




    Comment

    • John M

      #3
      Re: Getting the right record

      Thanks - it's a text box (I din't want a command button as i wanted a neat
      colour!) Anyway, point taken - double click is fine.

      In the meantime I have been seeking a solution and come up with what I think
      is a rather neat one. ..... using conditional format ..... the colour of the
      box changes as the form is opened .. and for some reason it has the right
      data. (I guess that in the process of altering the text box the relevant
      record gets the focus.)


      "Fletcher Arnold" <fletch@home.co m> wrote in message
      news:c17ika$5jg $1@hercules.bti nternet.com...[color=blue]
      > "John M" <john@jmawer.de mon.co.uk> wrote in message
      > news:c1756s$hsj $1$8302bc10@new s.demon.co.uk.. .[color=green]
      > > Hi,
      > >
      > > I have a continuous form which shows a record on each line. Further[/color]
      > details[color=green]
      > > are available by clicking on a box which runs code to open a further[/color][/color]
      form[color=blue]
      > to[color=green]
      > > give more details of the record. It works well. BUT you could well[/color][/color]
      have[color=blue][color=green]
      > > your cursor on one record and click on the box for extra details of[/color]
      > another.[color=green]
      > > The result is that the details of the wrong record are displayed.
      > >
      > > To find the right record I'm using
      > >
      > > stLinkCriteria = "[PosId]=" & Me![PosID]
      > > DoCmd.OpenForm stDocName, , , stLinkCriteria
      > >
      > > I guess I need a line of code which takes me to the relevant record[/color][/color]
      where[color=blue][color=green]
      > > the text box was clicked.
      > >
      > > Any ideas?[/color]
      >
      >
      >[color=green]
      > >Further details are available by clicking on a box ...[/color]
      >
      > What is this 'box'? If you put the code, say, in the double-click event[/color]
      of[color=blue]
      > a texbox on the continuous form, you could guarantee getting the right
      > record.
      >
      >
      > Fletcher
      >
      >
      >
      >[/color]


      Comment

      Working...