Results 1 to 12 of 12
  1. #1
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80

    multiple results

    on the main form, user enters last name into an unbound textbox, and afterupdate query selects the record. i use the dcount to determine if there is more than one person with that last name, and open a pop up with those members. i want to click a button to go to the selected record on the main form and i can't seem to make anything work. any help? i know somewhere along the line it means using the id field. just can't quite seem to make it work.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    You will need a command button on your popup form to bookmark the selection and bring your main form to the appropriate record.

    It may be easier to use an unbound main form and unbound search boxes. Then your search button can offer results in a subform. In the subform you can offer a dblclick event or a control button in a continuous form view. You can have the subform open a form for that requested record, a form that the user can interact with.

    You can program the subform by editing the VBA directly in the subform. It may be easier this way to match your PK. You should be able to use the wizard to help you out in creating a command button.

  3. #3
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80
    You again... Haha. Yea I saw some stuff about bookmarking. By the way all your help this weekend with the VBA and the command buttons (we were talking about confirm yes no buttons) has really gotten me off to a running start. I'm diving in head first and enjoying dabbling with it instead of using macros.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I am glad you are exploring.

    If your main form is bound to a table or query, you will most likely need to depend on .Bookmark and pass it via a recordsetclone.

    This is why I suggested the other approach. It creates another form, but you can turn your main form into more of a search form and maybe even use it as a template in other areas. Just something to consider

  5. #5
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80
    The main form is bound, so my options are either redesign my process to incorporate new forms, or figure out how to use a new bit of VBA. I think long term I'm better off learning the code, since it's more root cause of my problem and less work around. Plus something to add to the knowledge bank.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    June has a pretty good example here in Post # 9
    https://www.accessforums.net/forms/s...tml#post194488

  7. #7
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80
    update: i used this method http://stackoverflow.com/questions/1...pecific-record and all i had to do was modify the two forms i had a little bit, and change the order of which i call first, and bada bing!

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Is the other form (Main Form) already open when you use that? If I recall, I believe it will apply the filter if you use DoCmd.OpenForm with criteria.

    Is this what it is doing? Does it move to the record and apply the filter to the form it is opening? Can you remove the filter and view all of the records afterwards?

  9. #9
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80
    the other form is not open. to the best of my knowledge, the process is get the id from the record, make it an integer, open the form and go to that record.

    now i've got a whole new unrelated problem. i've got a list of people, on a continuous form, and i want to filter it, but i can only seem to filter everything or nothing. driving me nuts...

    basically, if i have a smith, and i type "smith" nothing happens, but if it time "sm" then it yields no results. i had a similar problem in another database where i even used a lookup to make sure the two fields were EXACTLY the same and had the same problem. what's the easiest way to filter a continuous form based on an unbound text box?

  10. #10
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    The way you worded post #1 I thought you were trying to locate a record within an open form. That is why I was curious about the DoCmd.OpenForm.

    If you need to adjust records on a continuous form, you wwill need to apply a WHERE clause to the form's recordsource or the form's filter. Just like in the example of the DoCmd.OpenForm. The example pplied specific criteria to the open form action.

    If you create a button and place the following into a click event, the code will illustrate a where clause. All you need to do is apply a filter to the form before clicking your new button. The filter will be displayed in a string. The string will appear in a msgbox and in the VBA editor's Immediate Window. You can display the Immediate Window with Ctrl + G.

    Dim strWhere As String
    strWhere = Me.Filter
    MsgBox strWhere
    Debug.Print strWhere

    You can add this string to an SQL statement or to various built in functions, including a DoCmd.OpenForm.

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I am not sure why you are not able to use the search function on your continuous form. There are different options to search the current record, the entire record and wildcards for beginning middle and end. Double check to make sure you are applying the correct type of search to your field/form.

  12. #12
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80
    It was just a problem with "" I found my answer elsewhere in the forum

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

Similar Threads

  1. Replies: 5
    Last Post: 05-21-2013, 02:21 PM
  2. Replies: 1
    Last Post: 02-04-2012, 02:07 AM
  3. Multiple field results
    By ronchetc in forum Queries
    Replies: 1
    Last Post: 05-24-2011, 10:03 AM
  4. Iff with multiple results?
    By monkeyman in forum Queries
    Replies: 1
    Last Post: 05-19-2011, 02:27 PM
  5. Multiple Query Results Sorted Together
    By Rawb in forum Reports
    Replies: 1
    Last Post: 12-10-2009, 04:05 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