Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Ventura, California, USA
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    LIst Box Form Update (2002)

    I need a refresher. I havent been in Access in a bit so here is something simple that is baffling me. I need the code that allows a List box from the header to update the form. I want my users to pick a state from the header list box and all the states info to come up on the form. Anyone have some code??

    Thanks,


    Dan

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: LIst Box Form Update (2002)

    If you use the wizard to create the listbox, it will write the code for you. In version 2000, it looks something like:

    <pre>Private Sub FindCourse_AfterUpdate()
    'Find the record that matches the control

    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[CourseNumber] = " & "'" & Me![FindCourse] & "'"
    Me.Bookmark = rs.Bookmark
    Me![FindCourse] = ""

    End Sub</pre>


    I used Courses and their CourseNumber, you would use State and your State key. HTH

Posting Permissions

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