Results 1 to 4 of 4
  1. #1
    Rauf is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    May 2013
    Posts
    12

    Search,Print and Add new Record


    Hi,
    I am new to Ms Access and going to develop a database, would appreciate your suggestions in the following:

    I have a created a table "BCt" with the following fields,
    1. IDNumer 2. FirstName 3.LastName 4.Dateofbirth 5.PlaceOfBirth 6.Father'sName 7.Mother'sName

    Now want to create a Form with the following options:

    1. Command button to "Search" record by I.D Number (or may be DateofBirth)
    2. Command button to "Print" the searched record
    3. If not found, Command button to "Add" new record


    Regards
    Rauf

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I'm assuming their IDNumber is not an autonumber field, but instead something like a social security number or other unique identifier.

    Create a form and call it 'frm_DataEntry' with an unbound control. Name the unbound control 'Search_String'

    Create a query and name it 'qry_DataEntry' with your table Bct as it's source. Add all the fields.

    In the criteria of the IDNumber field put

    Like "*" & [Forms]![frm_DataEntry]![Search_String] & "*"

    this will let you search for all or a portion of the ID

    If you want to search for the complete ID and nothing but that then your criteria would be

    [Forms]![frm_DataEntry]![Search_String]

    In the RECORD SOURCE control of your form frm_DataEntry put in the query name (qry_DataEntry)

    Add all the fields you want to display
    in the ON EXIT property of your SEARCH_STRING unbound control add the code

    me.requery

    If there is no matching record in the IDNumber field it will come up blank and you can enter your data
    If there is a matching record it will bring it up as well.

  3. #3
    Rauf is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    Thank you so much for replying with such a useful information. I'll update my database and will come back for some more useful advices.

    Rregards

  4. #4
    Rauf is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    forgot to tell you that you guessed right that idnumber is not auto but the identity card number/passport number etc.

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

Similar Threads

  1. Replies: 5
    Last Post: 10-26-2011, 02:59 PM
  2. How to Print Selected Record
    By indranx in forum Reports
    Replies: 2
    Last Post: 05-31-2011, 09:54 PM
  3. Print a specific record
    By NISMOJim in forum Forms
    Replies: 5
    Last Post: 01-28-2011, 04:32 PM
  4. Print Single Record
    By stattech in forum Reports
    Replies: 5
    Last Post: 10-05-2010, 03:38 AM
  5. Print a different image per record
    By mcaldwell in forum Reports
    Replies: 5
    Last Post: 04-24-2009, 02:00 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