Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Bookmark from a list (2002)

    Hi,

    I'm making some revisions to a database I set up over 4 years ago for a friend. Needless to say, after all I've learned on this forum I wouldn't have it set up the way I do. With that being said, I also don't have time to change it especially since its working fine. The user wants some additions. I'm running into a problem because all of the tables are not set up with an autonumber. I have tables that are simply used as data entry choices. One such table is tblActivityLegend. The user wants to be able to add to this table. I have the form set up with a lstActivity to show the activities that are present. I want the user to be able to click on the list and have the corresponding activity come up in a text box. The code I'm using (in the after update event) isn't working I "think" because the syntax means its looking for a number and not text. In this situation is should be looking for text. I've tried changing the code many times with no luck.

    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Activity Legend] = " & Str(Me![LstActivity])
    Me.Bookmark = rs.Bookmark

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Bookmark from a list (2002)

    Try this:

    rs.FindFirst "[Activity Legend] = " & Chr(34) & Me![LstActivity] & Chr(34)

    Chr(34) is the quote character <code>"</code>
    used to delimit a text value.

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Bookmark from a list (2002)

    Hi Hans,

    Tried it but am getting nothing. I stripped down the database for you to take a look.

    Thanks,
    Leesha

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Bookmark from a list (2002)

    I'm sorry, I don't understand. The database you attached has only one table with only one field. What is the purpose of the form and of the list box? <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29> <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    BTW, the line Me.Bookmark = rs.Bookmark is missing from the code.
    BTW2: no need to have both an On Click and After Update event for the list box. After Update is sufficient.

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Bookmark from a list (2002)

    Giggling, the purpose of the form is so that the user can add more activiities. The table itself is used as a lookup table for other forms. I only included the stripped down version.

    The missing me.bookmark - rs.bookmark did the trick!
    Thanks,
    Leesha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •