Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2004
    Posts
    8

    Unanswered: simple record search

    hello, im a total access newbie and have no clue what im doing, however, im trying to set up a simple record search. this is what i would like to do. bring up a search form, enter a name into a text box, click search, have that bring up all the results in a listbox, and then i would be able to double click on any one of the results in the list box to bring up the record.

    i thought i found something that could help me (found here) however, it uses listboxes for selection and i just simply cant follow the code

    i guess my question is, is there anyway to do this in access without having to look at any code?

    thanks.

  2. #2
    Join Date
    Jun 2004
    Posts
    8
    ok, new question

    how can i chage this line
    SELECT [Cendant Servers].ID, [Cendant Servers].SERVER_NAME FROM [Cendant Servers];

    to search using whatever i have inputted into the text box rather than display everything from the table

  3. #3
    Join Date
    Jun 2004
    Posts
    55
    SELECT [Cendant Servers].ID, [Cendant Servers].SERVER_NAME FROM [Cendant Servers] WHERE [Cendant Servers].[SERVER_NAME] = [Forms]![Name of your Form]![Name of your textbox];

  4. #4
    Join Date
    Jun 2004
    Posts
    8
    cool, thansk for the reply. my question now is, do i have to set any options for the text box? or is the listbox supposed to update whenever something is typed into the text box??

  5. #5
    Join Date
    Jun 2004
    Posts
    55
    Are you using that SQL on a query? If so you have to use this VBA coding:

    Me.Nameoflistbox.RowSource = "NameofQuery"

  6. #6
    Join Date
    Jun 2004
    Posts
    8
    thank you very much for your help, im now able to get the results in the list box . now, the only thing left is how do i get the record to pop up when i double click the entry in the list box?

    what im trying to do right now is run a macro so when you double click on an entry, it does a gotorecord. however, i can figure out what to put in for the offset mask for it to go to the right record. i dont even know if its possible to do it this way
    Last edited by altezza2k2; 06-28-04 at 15:33.

  7. #7
    Join Date
    Jun 2004
    Posts
    55
    No...it's something to do with the OpenArgs function in the DoCmd.OpenForm function.

    What you have to do is got into the list boxes properties and use the On Dbl Click event and select code builder. Then input: (Here I'm assuming you're showing the Server Name in the list box)

    DoCmd.OpenForm "NameofFormtobeopened", , , , , , "[Server Name] = [Forms]![NameofFormwiththelistbox]![Nameoflistbox]"

    Now in the form that you're going to opeen you have to goto the forms properties. (Or the little grey box top left hand corner when you're in design view). Use the On Open event and input:

    Me.Filter = OpenArgs
    Me.FilterOn = True
    Last edited by dwil2g1; 06-29-04 at 12:22.

Posting Permissions

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