Results 1 to 3 of 3
  1. #1
    libraccess's Avatar
    libraccess is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Napier New Zealand
    Posts
    129

    Search a Subform

    I might be on the wrong track completely
    I want to search a subform, of course the search only looks at the current form not all the records ever entered .


    Soooo I have in the subform a search btn
    Private Sub btnSearch_Click()
    DoCmd.Close acForm, "frmMainDel", acSaveYes
    DoCmd.OpenForm "frmSubDel", acNormal
    End Sub
    closes the form (and Sub) and opens the sub on its own with all the records
    search works, I then have an exit btn under the search btn which is now visible False
    Private Sub btnClose_Click()
    DoCmd.Close acForm, "frmSubDel", acNormal
    DoCmd.OpenForm "frmMainDel", acNormal
    End Sub
    which takes me back to the Main Form
    The problem my first control in my sub is
    Private Sub DateSub_LostFocus()
    If Me.DateSub = "" Or IsNull(Me.DateSub) Then
    MsgBox "Mandatory Field. A Delivery Date is Required.
    Exit Sub
    End If
    End Sub
    Of course when the Main Form is on a New Record this MsgBox pops up
    How can I stop this or is there a better way?
    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    Why do you need to do a search of subform full dataset? What do you do with the result of the search? Do you want to provide project for analysis? Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    libraccess's Avatar
    libraccess is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Napier New Zealand
    Posts
    129
    Ummm the DB is a bit big to post and is now in use. Staff member has used the Access search box on other apps and was puzzled as to why the search would not work. Ihave demonstrated how to drill down info in the report for these details and I hope that will do. Still it did seem quite handy one click (except for the msgbox if on a new rec) and there it is. Never mind thanks for your help

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

Similar Threads

  1. Search in subform
    By Wayne311 in forum Forms
    Replies: 1
    Last Post: 03-06-2013, 06:09 AM
  2. Search Box Requerying Subform problem
    By cbh35711 in forum Access
    Replies: 1
    Last Post: 03-30-2012, 09:37 AM
  3. Search in a table and display subform
    By smahdih in forum Access
    Replies: 2
    Last Post: 10-29-2011, 01:46 PM
  4. Create combo search form in subform
    By grant.smalley in forum Forms
    Replies: 6
    Last Post: 02-19-2010, 04:37 AM
  5. Replies: 1
    Last Post: 03-28-2007, 09:18 AM

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