Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2008
    Posts
    163

    Unanswered: Naviagation through list boxes

    I'm using forms to view data (disabled editing, deletion and addition options). I want to create a list box that serves as a navigation method (in addition to the go to next, prev, first and last buttons I already have).

    The list or combo box will have entries identical to one of my pk fields. What's the best method of doing this?

  2. #2
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185
    Use Search for record method on your list box On Click event or combo box After Update event:
    Code:
    DoCmd.SearchForRecord acDataForm, "frm_Name", acFirst, "[frm_SearchField] = " & str(Nz(Screen.ActiveControl, 0))
    <<Never Walk on the Traveled Path, Because it only Leads you to where the Others have been.>>
    Graham Bell

  3. #3
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Quote Originally Posted by coffeecat
    The list or combo box will have entries identical to one of my pk fields. What's the best method of doing this?
    Create a combo box using the wizard. Choose the "lookup values in the table" option, and the wizard will create the VBA code for you.

    Hope this helps,
    Sam

  4. #4
    Join Date
    Jun 2008
    Posts
    163
    Thanks for the help guys! =D

    DoCmd.SearchForRecord acDataForm, "frm_Name", acFirst, "[frm_SearchField] = " & str(Nz(Screen.ActiveControl, 0))
    Btw, what does "str(Nz(Screen.ActiveControl, 0))" mean?

Posting Permissions

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