Results 1 to 6 of 6
  1. #1
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58

    Navigation & Search form help

    So following a video I was able to create a multi field search text box on a split form which works like it should. Used a macro with the following condition = [Offender Name] Like "*" & Forms![Form: Search]!Text12 & "*" Or [Notes History] Like "*" & Forms![Form: Search]!Text12 & "*"



    The problem I am running into is when I try to move the split Form: Search to my Navigation form (tabs at the top like a webpage). Once moved to the navigation form, whenever I click on the tab for the search form, a pop up box generates with the following message:

    ----------------------------------
    Enter Parameter Value [?][X]
    ----------------------------------
    Forms!Form: Search!Text12

    (text box to enter data)
    -------------------------------

    How would I go about fixing this? I've tried changing the macro from [Form: Search] to [Form: Main Menu] (name of the main navigation form) and I still get the same pop up box. I'm no IT guy, just a guy who works in inventory and watched a couple videos online to make this DB, so please explain it like I'm 5 years old haha.

    thanks in advance
    Niko

  2. #2
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58
    After some more searching I found the follow: Unfortunately, split forms will not work on subforms and will only show one view. So when you place the split form onto the Navigation form, it is treated as a subform, thus it doesn’t work.

    Guess I'm SOL on this option.

    If the above isn't an option, anyone have some advice/direction I could go in to create a search form/pop up/?? so I can search two fields without having to go into the backend?

  3. #3
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    check out this video and see if it is helpful

    http://www.datapigtechnologies.com/f...earchform.html

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Can you post a copy of the database, and instructions to get us to the problem issue?

    Do you have to use a split form? What other options/constraints apply?

  5. #5
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58
    I don't have to use a split form, I was just following the directions I had seen in a video. I did some more searching online and came across this ( http://www.iaccessworld.com/create-s...vba-ms-access/ ) but its pretty VBA heavy, least for me with almost no VBA knowledge. Think I might be able to stumble my way through it, but if there is an easier option I'm all for it.

    I am open to anything that will allow me to search two different fields. This is my creation/DB so I have full control over design and what have you.

    I would be more than happy to post a copy of the database if someone could give instructions or link me to a page that explains how one would go about doing such.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Two thoughts.

    1---Have you seen this search by Allen Browne?

    2---Here is code behind a button I use on a form.
    I have 1 textbox that can be used to search for numbers or names.
    This code just produces Msgbox to show code that would be used to do the search.

    Code:
    Private Sub btnSearch_Click()
    'sample code to show single search  box to invoke
    'a) sql to find number, or
    'b) sql to find name (text)
    
    10       On Error GoTo btnSearch_Click_Error
    
    20
    30    If IsNull(Me.txtSearchValue) Or Len(Me.txtSearchValue) = 0 Then
    40      MsgBox "You must enter a Value to Search for in the textBox"
    50      Me.txtSearchValue.SetFocus
    60      Exit Sub
    70    End If
    80    If Left(Me.txtSearchValue, 1) Like "[0-9]" Then
            'searching for number
    90      MsgBox "Use code to search for Number " & vbCrLf _
                   & "select * from tblEmployees where [employee number] =" & CLng(Me.txtSearchValue)
    100   Else
            'searching for Name
    110     MsgBox "Use code to search for Surname " & vbCrLf _
                   & "select * from tblEmployees where [name] = '" & Me.txtSearchValue & "'"
    120   End If
      
    btnSearch_Click_Exit:
    130      Exit Sub
    
    btnSearch_Click_Error:
    140      MsgBox "Error " & err.number & " in line " & Erl & " (" & err.Description & ") in procedure btnSearch_Click of VBA Document Form_frmSearchNumberOrName"
    150      Resume btnSearch_Click_Exit
    
    End Sub

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

Similar Threads

  1. Replies: 1
    Last Post: 12-05-2016, 07:06 PM
  2. Replies: 2
    Last Post: 08-18-2016, 11:59 AM
  3. Replies: 3
    Last Post: 10-31-2014, 08:08 AM
  4. Navigation Menu and Search Form error
    By pbouk in forum Forms
    Replies: 5
    Last Post: 03-06-2013, 12:42 PM
  5. Replies: 1
    Last Post: 02-20-2012, 10:56 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