Results 1 to 3 of 3
  1. #1
    aparnawangu is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2015
    Posts
    40

    Serch Form creation in access

    Hi All,



    I am very new to access programming.I want to create a search form where i can search by means of textbox and combobox for selected fields.
    I need a show all button also to show all the records in one go.
    I am attaching the table in XSLx format.I need to search by all the columns.
    For Enquiry Form No,Timings Required,Interested In,Suitable timings of children i need a combobox search
    Rest of the fields Textbox search.
    Pls help me out.
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    make a form, frmFind, that is a multi-record form to show all records.
    put all your boxes to search and a FIND button.

    You cant use form boxes in a query if there's nothing in them..so..
    Test all controls for a possible filter then build the where clause, then filter the records.


    Code:
    if not isnull(cboState) then   sWhere = sWhere & " and [state]='" & cboState & "'"
    if not IsNull(txtName) then    sWhere = sWhere & " and [Name]='" & txtName & "'"
    if not IsNull(chkContact) then sWhere = sWhere & " and [Contact]=" & chkContact.value
    
    
        'remove 1st And
    if len(sWhere)>0 then sWhere= mid(sWhere,5)
    
    
      'just use the filter
    iLen = Len(sWhere) - 5
    If iLen <= 0 Then
        me.filterOn = false
    Else
        me.filter = sWhere
        me.filterOn = true
    End If
    NOTE: your [timeings required] field is fine for info only, but if you mean to perform checks or queries on it , it is useless the way you have it.
    But if it is just to view the time span, its OK.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

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

Similar Threads

  1. Replies: 10
    Last Post: 04-25-2014, 12:53 PM
  2. Replies: 8
    Last Post: 07-18-2013, 01:52 PM
  3. Access 2007 - Form Creation
    By p4ck3tl055 in forum Forms
    Replies: 5
    Last Post: 03-18-2010, 12:43 PM
  4. Date and time serch
    By gayano in forum Programming
    Replies: 1
    Last Post: 08-31-2007, 03:49 AM
  5. Time and date serch
    By gayano in forum Access
    Replies: 0
    Last Post: 07-05-2007, 07:59 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