Re: Move through a list box.
- From: "Ron Weiner" <weinNoSpam1@xxxxxxxxxxxxxx>
- Date: Wed, 21 Sep 2005 07:39:03 -0400
Try this
lstBill_List.Value = TheNewBillValue
lstBill_List.Selected(lstBill_List.ListIndex) = True
Basically two steps. First set the value of the list box to the newly
created record ID and then make that row the selected item in the list.
--
Ron W
www.WorksRite.com
"Jarryd" <Jarryd@xxxxxxxxxxxxxxxxxx> wrote in message
news:OdK7wzovFHA.3236@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I have an unbound list box that is populated by a query. Clicking on a
> value in the list box moves to the record in the recordset that matches
the
> value chosen in the list with a specified field:
>
> Private Sub lstBill_List_AfterUpdate()
> Dim rs As Object
>
> Set rs = Me.Recordset.Clone
> rs.FindFirst "[Bill] = '" & Me!lstBill_List & "'"
> If Not rs.EOF Then Me.Bookmark = rs.Bookmark
>
> End Sub
>
> Now that is working well. The next thing I have done is created a
procedure
> triggered by the Click event of a button to add a value to the table that
is
> queried to populate the list box. So the value is added and the list box
> requeried. I have also got the form to move to the newly created record.
> What I can't do is get the list box to move its position to the newly
added
> value. Does anyone know how you move through items in an unbound list
box?
>
> TIA,
>
> Jarryd
>
>
.
- Follow-Ups:
- Re: Move through a list box.
- From: Jarryd
- Re: Move through a list box.
- References:
- Move through a list box.
- From: Jarryd
- Move through a list box.
- Prev by Date: Re: Sending info from an Access form to an IE form
- Next by Date: Re: list box for each coding
- Previous by thread: Move through a list box.
- Next by thread: Re: Move through a list box.
- Index(es):
Loading