Results 1 to 5 of 5
  1. #1
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    advance search record

    Hi,
    i want to make search on first_name and second_name ?
    in form i have two fileds ,firstname. second name,i will enter into both fileds ,
    if that names are found before will gvie warning box you want to see Yes/No display all related info in database with main form and subform .
    my database structure is:-
    main form with first and second name,sub form with date_visit and descption.



    note:-this part of my question
    this my problem still no body solve it

    thx

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    - Your Tables & Forms go Right to Left. I've never seen that in Access!

    There's no data in your Database that you attached.

    I would:

    Table1:
    PersonID: Integer [Not AutoNumber like you have].
    Fname: Text, 25.
    LName: Text, 25.

    Table2:
    PersonID: Integer [Same as PersonID in Table1].
    VisitDate: Date.
    Description: Text, 255 [or shorter].

    If a PersonID can have more than one Visit - then make your subForm into a Datasheet so that all Visits will show up for each PersonID.

    You can try making your Main Form a Search Form based on values in Table 1 with ComboBoxes for cmbPersonID, cmbFName & cmbLName.

    When a person selects a PersonID from the PersonID ComboBox and clicks a 'Search' Button [for example], you can open the Sub Form with code like this in the Click event for the Search Button:

    Code:
     
    DoCmd.OpenForm "SubForm", , , "PersonID = " & Me.cmbPersonID
    When a person selects a FName from the FName ComboBox and clicks the 'Search' Button, you can open the Sub Form with code like this in the Click event for the Search Button:

    Code:
     
    DoCmd.OpenForm "SecondFormName", , , "FieldName = '" & Me.cmbFName & "'"
    OR:
    You can link your Main Form to your Sub Form using PersonID as the Link field. Make the Sub Form a Child Form of Main Form.
    Then, when you select a PerosnID from your Main Form, the Sub Form will show all visits for that PersonID on the Sub Form.

    Here's a link to a page that will help you with this project of yours:
    http://office.microsoft.com/en-us/ac...010098674.aspx

    I hope this helps!

  3. #3
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    see with update

    Hi,
    friend i put some info see attched file
    plz put ur code on it


    thanks

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You should try doing it yourself. It will take longer, but that's how you learn.



    All the best! Let us know if you run into problems after you try for yourself.

  5. #5
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    let try

    Hi,
    I will try that code,if i fail i will ask for ur help

    thx

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

Similar Threads

  1. create fields on the fly or in advance?
    By zac123 in forum Access
    Replies: 4
    Last Post: 08-08-2011, 06:37 AM
  2. Advance to next row in report
    By jgelpi16 in forum Reports
    Replies: 2
    Last Post: 01-29-2011, 10:40 PM
  3. advance date reminder
    By Denis in forum Database Design
    Replies: 1
    Last Post: 11-14-2010, 07:40 AM
  4. Advance Report Help
    By OldCityCat in forum Reports
    Replies: 1
    Last Post: 09-18-2010, 07:58 AM
  5. Replies: 3
    Last Post: 02-19-2010, 04:19 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