Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2015-02-06
15
Medium Priority
?
90 Views
Last Modified: 2015-02-06
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
0
Comment
Question by:Shaft960
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
15 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40593484
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
 

Author Comment

by:Shaft960
ID: 40594816
Does it matter that the form "MasterCamp" is already open?
0
 

Author Comment

by:Shaft960
ID: 40594825
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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40594942
did you try the code posted above?
0
 

Author Comment

by:Shaft960
ID: 40594945
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40594951
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
 

Author Comment

by:Shaft960
ID: 40594964
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
 

Author Comment

by:Shaft960
ID: 40594990
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
 

Author Comment

by:Shaft960
ID: 40594993
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40594996
upload a copy of your db
0
 

Author Comment

by:Shaft960
ID: 40595011
Click on Camper Data, and then click on the Reservation # button on the left.
Camping.mdb
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40595039
after clicking "Reservation # button " then how do we proceed?

what do you do next,
and what do you expect..
0
 

Author Comment

by:Shaft960
ID: 40595048
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
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 40595062
test this
Camping-rev.mdb
0
 

Author Closing Comment

by:Shaft960
ID: 40595087
Thank you very much...
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question