Results 1 to 4 of 4
  1. #1
    sadath is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    2

    Search and Retrieve

    I am new to access, I need to accomplish a task ASAP. Kindly help me guys

    I have 4 colums

    ID ________ Name______ Ref ________code
    000033______AFAAF______ 19011961 ______ 9
    010000 ______ MAURICE______ 30061939______ 6
    010015 ______VARTOO ______ 30061943______ 7
    010044 ______NAJAH______ 08111955______ 2
    010093 ______ NASER______ 02121936______ 3
    010138______ GHULAM ______ 30061945 ______3
    010369 ______ SUMAYA ______ 30061940______ 5
    010489 ______KHADIJ______ 24081934 ______2
    010044 ______NAJAH______ 08111955 ______ 5
    010138 ______ GHULAM ______ 30061945______ 1
    010369 ______ SUMAYA ______30061940______ 6

    I want to build a form, where i can enter the ID and and it search and retrieves all the corresponding Code(column D) values in the same form, respectively for all the instance of the ID (there may be multiple instance of the ID)

    Thanx in advance

  2. #2
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Try something like this. You would have a main form and in the header section, create an unbound text box and we'll call it txtCode. Then add your form into the detail secion of this form and name it fsub. Now, on the form where you placed the unbound text box in the header section, create a command button and in its On Click event do something like below.

    dim strFilter as String

    if isNull(Me.txtCode) Then
    Exit Sub
    End If

    strFilter= "[Code]=" & Me.Code

    me.fsub.Form.FilteOn = True
    me.fsub.Form.Filter = strFilter

    I usually do it this way with sub-forms because you can do datasheet views.

  3. #3
    sadath is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    2
    Thank you for your solution, But I am sorry to say that I didnt get what you meant by "add your form into the detail secion of this form and name it fsub". I created a form header with onbound text and named in txtCode, then i created the button and added the coding you gave me, now when i click the form, nothing is displayed even the header. I am a newbie, not worked with access much. But i can do it if you guide me step by step.

  4. #4
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Create another form that will have the datasource that you're using. When you create that, drag it into the detail section of the form.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Retrieve similar records
    By dodell in forum Queries
    Replies: 3
    Last Post: 03-31-2010, 11:48 AM
  2. Unable to retrieve data on Comboboxes
    By ditogui in forum Forms
    Replies: 8
    Last Post: 12-29-2009, 10:26 AM
  3. Replies: 3
    Last Post: 10-06-2009, 02:11 PM
  4. Replies: 0
    Last Post: 06-03-2009, 10:25 PM
  5. Replies: 1
    Last Post: 06-20-2007, 07:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums