LIST BOX

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

    LIST BOX

    How does one open a form from a List Box? I want to to choose the
    record from the List Box to reopen it on another form. I've got the
    list box. I can choose a record in the List Box. But when I close the
    List Box form the other form doesn't go to that record.
    Thanks
    DS
  • Salad

    #2
    Re: LIST BOX

    DS wrote:
    [color=blue]
    > How does one open a form from a List Box? I want to to choose the
    > record from the List Box to reopen it on another form. I've got the
    > list box. I can choose a record in the List Box. But when I close the
    > List Box form the other form doesn't go to that record.
    > Thanks
    > DS[/color]

    If the listbox is named List0 and the primary key for the record to be
    opened is called ID, something like this
    Docmd.OpenForm "YourFormName", ,,"ID = " & Me.List0

    I'd put something like this into the Dbl-Click event of the listbox.
    This way you can keep both forms open.

    Comment

    • Bas Cost Budde

      #3
      Re: LIST BOX

      DS wrote:[color=blue]
      > How does one open a form from a List Box? I want to to choose the
      > record from the List Box to reopen it on another form. I've got the
      > list box. I can choose a record in the List Box. But when I close the
      > List Box form the other form doesn't go to that record.
      > Thanks
      > DS[/color]

      Try the Form wizard to create a form on two tables; the wizard should
      offer the choice between (a) form-subform and (b) related forms. You
      will want to see what happens in (b).

      --
      Bas Cost Budde, Holland

      I prefer human mail above automated so in my address
      replace the queue with a tea

      Comment

      • DS

        #4
        Re: LIST BOX

        Salad wrote:[color=blue]
        > DS wrote:
        >[color=green]
        >> How does one open a form from a List Box? I want to to choose the
        >> record from the List Box to reopen it on another form. I've got the
        >> list box. I can choose a record in the List Box. But when I close
        >> the List Box form the other form doesn't go to that record.
        >> Thanks
        >> DS[/color]
        >
        >
        > If the listbox is named List0 and the primary key for the record to be
        > opened is called ID, something like this
        > Docmd.OpenForm "YourFormName", ,,"ID = " & Me.List0
        >
        > I'd put something like this into the Dbl-Click event of the listbox.
        > This way you can keep both forms open.[/color]
        Thanks, I'm close, but I misquoted myself. The form with the record is
        already open. I just need to go to the record on that form from the
        form with the List Box. Thanks
        DS

        Comment

        • Salad

          #5
          Re: LIST BOX

          DS wrote:
          [color=blue]
          > Salad wrote:
          >[color=green]
          >> DS wrote:
          >>[color=darkred]
          >>> How does one open a form from a List Box? I want to to choose the
          >>> record from the List Box to reopen it on another form. I've got the
          >>> list box. I can choose a record in the List Box. But when I close
          >>> the List Box form the other form doesn't go to that record.
          >>> Thanks
          >>> DS[/color]
          >>
          >>
          >>
          >> If the listbox is named List0 and the primary key for the record to be
          >> opened is called ID, something like this
          >> Docmd.OpenForm "YourFormName", ,,"ID = " & Me.List0
          >>
          >> I'd put something like this into the Dbl-Click event of the listbox.
          >> This way you can keep both forms open.[/color]
          >
          > Thanks, I'm close, but I misquoted myself. The form with the record is
          > already open. I just need to go to the record on that form from the
          > form with the List Box. Thanks
          > DS[/color]

          Oh. Ok, maybe this will set you in the right direction

          Dim rst As REcordset
          set rst = forms!form!Seco ndFormName.form .recordsetclone
          rst.findfirst "ID = " & Me.list0
          forms!form!Seco ndFormName.form .bookmark = rst.bookmark
          rst.close
          set rst = Nothing
          Docmd.SelectObj ect acForm, "SecondFormName "

          Comment

          Working...