Move to a record on a form based on another forms data

This code is working to find the record in the other form but the records are filtered and it only shows one record... I want the code to bring me to the record on that form but not be filtered and show all of the other records..

Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "MasterCamp"
   
    stLinkCriteria = "[ID]=" & Me![ID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
   
    DoCmd.Close acForm, Me.name
Shaft960Asked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
test this
Camping-rev.mdb
0
 
Rey Obrero (Capricorn1)Commented:
try this codes

Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "MasterCamp"
       DoCmd.OpenForm stDocName, openargs:=Me.[ID]
      

in the load event of form "MasterCamp", place this codes

private sub form_load()
if me.openargs & ""<>"" then

with me.recordsetclone
      .findfirst "[ID]=" & me.openargs
      if not .nomatch then
            me.bookmark=.bookmark
            else
            msgbox "Record not found"
      end if
end with

end sub
0
 
Shaft960Author Commented:
Does it matter that the form "MasterCamp" is already open?
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
Shaft960Author Commented:
Everything that I had in the code is working except for the fact that it is filtering all of the records and only showing the one record.  I want it to go to the record yet still have all the other records available.
0
 
Rey Obrero (Capricorn1)Commented:
did you try the code posted above?
0
 
Shaft960Author Commented:
Not yet, because I didn't see any coding to close the popup form... Do I put this coding in the button on the popup form and also in the onload of the already open MasterCamp form?
0
 
Rey Obrero (Capricorn1)Commented:
in your original code, you are opening the form "MasterCamp" .

close the form "MasterCamp", then open it using the codes I posted,

and READ the suggestion.
0
 
Shaft960Author Commented:
Please look at the attached photo.. I don't want MasterCamp closed.  The second form that is on top is small... Currently when I click the "Go To" button on the small form it takes me to the correct record on the MasterCamp form but that is the only record available... I just want to go to that record but have the other records visible.
0
 
Shaft960Author Commented:
I tried it and it doesn't even change the record to the correct record now.... all I wanted it to do is show all the records rather that just one filtered one..
0
 
Shaft960Author Commented:
This coding brings me to exactly what I want except that it only shows the one record... I want the form to be on that record but in the navigation it shouldn't say 1 of 1 (Filtered)

Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "MasterCamp"
   
    stLinkCriteria = "[ID]=" & Me![ID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
   
    DoCmd.Close acForm, Me.name
0
 
Rey Obrero (Capricorn1)Commented:
upload a copy of your db
0
 
Shaft960Author Commented:
Click on Camper Data, and then click on the Reservation # button on the left.
Camping.mdb
0
 
Rey Obrero (Capricorn1)Commented:
after clicking "Reservation # button " then how do we proceed?

what do you do next,
and what do you expect..
0
 
Shaft960Author Commented:
You find a reservation number that you want.. by searching in the combo box... then you click the little "Go To" button... in closes that form and moves to the correct record in MasterCamp but the records are filtered to only one record...I want to be on that record but have the bottom navagation control show all of the records..
0
 
Shaft960Author Commented:
Thank you very much...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.