Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    jakeao is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2009
    Posts
    16

    More search questions


    Now I'm trying to search for a category of things. I want the person tp type in the category, and then have the search button open the search in a new form, allowing the person to scroll through the items, select the one they want, and then have that information show up in the original form. Thanks again for all the help on this little project of mine.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So what part is keeping you from completing this project? What have you got running so far?

  3. #3
    jakeao is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2009
    Posts
    16
    I got the search to sort of work. It brings up the first record, but not multiple ones in the popup form. I'm also missing the part that has the selected record in the popup form populate the origrinal form. I thought I had that part working but it would just return a random record to the main form. This Access stuff is way harder than I thought it would be. Thanks again for helping me out.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is your 2nd form in Continuous form or Datasheet mode? What method are you using to locate the 1st record?

  5. #5
    jakeao is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2009
    Posts
    16
    My popup form is a continuous form. here is the code I'm using for the search.

    Private Sub keywordSearch_Click()
    If IsNull(keywordsearchbox) = False Then
    Me.Recordset.FindFirst "[keyword]='" & Me.keywordsearchbox & "'"
    Me!keywordsearchbox = Null
    If Me.Recordset.NoMatch Then
    MsgBox "Error.", vbOKOnly + vbInformation, "Error."
    End If
    End If
    End Sub


    I was thinking this would work for what I want but now I'm not sure. I thought I would have it start on the first record once it opens the popup form. Does that make any sense?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Why not have your next form bound to a query that uses your first form as the criteria?

  7. #7
    jakeao is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2009
    Posts
    16
    I'm not very familiar wirh queries. how would I set that up?

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Use the query builder to create a query that returns what you want and references your keyword field in the form in the criteria area of that field.

  9. #9
    jakeao is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2009
    Posts
    16
    OK, here is what I have for code now.

    Code:
    Private Sub Keywordsearch_Click()
    'this opens the "mpl" form based on the choice in the "keywordsearhc field"'
       If IsNull(keywordsearchbox) = False Then
          DoCmd.OpenForm "mpl", , , "[keyword]='" & Me.keywordsearchbox & "'"
          'I need to figure out the error message stuff'
          If Me.Recordset.NoMatch Then
             Me!searchbox = Null
             If Me.Recordset.NoMatch Then
                MsgBox "Error.", vbOKOnly + vbInformation, "Error."
             End If
          End If
       End If
    End Sub
    It works ok. I still need to figure out the error message stuff on it. My main issue now is that I need to put the selected record back in the main form. I can get it to close, I just need the selected record to transfer first.

    Private Sub mplselect_Click()
    DoCmd.Close acForm, "mpl", acSaveNo
    End Sub

    Any Ideas? Thanks

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by jakeao View Post
    My main issue now is that I need to put the selected record back in the main form. I can get it to close, I just need the selected record to transfer first.
    I'm not sure what this means. Is there some piece of data you need to retrieve from the other form?

  11. #11
    jakeao is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2009
    Posts
    16
    Let me see if I can clarify what I'm trying to do. My main form is called "parts lookup". I can search in "parts lookup" by category (I can lookup all the circuit breakers I have on hand). When I search by category it brings the results up in a new popup form called "mpl" (mutil parts lookup). I want to be able to select one of the records from the list that comes in "mpl" and have the detailed information be returned to "parts Lookup".

    I have every step of this working, except the part about returning the selected record back to "parts lookup". I can e-mail the files if that would help.

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You can zip it up and post it as an attachment right here if it is < 2MB.

  13. #13
    jakeao is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2009
    Posts
    16
    Here are the files. Thanks a lot for all the help.

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's one way to do it.

  15. #15
    jakeao is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2009
    Posts
    16
    Thanks. That seems to work . Would you be willing to break down just what exactly the program is doing. I don't quite understand how it works.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. HELP, Access questions.
    By brown in forum Access
    Replies: 0
    Last Post: 04-21-2009, 03:31 PM
  2. Compatibility Questions
    By smschleidt in forum Access
    Replies: 0
    Last Post: 12-23-2008, 12:35 PM
  3. 3 questions about forms
    By surfer_rosa in forum Forms
    Replies: 0
    Last Post: 10-08-2008, 09:59 AM
  4. newbie questions
    By bigmac in forum Access
    Replies: 0
    Last Post: 10-07-2008, 12:53 AM
  5. New to this forum and have questions
    By Sinatra Fan in forum Access
    Replies: 4
    Last Post: 04-14-2006, 06:53 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