AHHH, the ACC2010 navigation control.
First read this thread to learn a bit about the ACC2010 style navigation control.
https://bytes.com/topic/access/answe...ms#post3760995
It is very importaint that you understand what is happening post#2 should help with that point.
Next I need to see the actual
DoCmd.BrowseTo (read more) that you used.
-- Do a copy and paste within the post box, select that text, and then format it using the
[CODE/] tool. -- There is an example in this link that will serve as a basis for what we need to do to get you to the correct record.
I Use the BrowseTo method in an inventory control database and have great success; however, it didn't come easily at the time (most of the articles were/are not all that informative :) ) and here is an example from one of navigation forms I've built in the past:
- DoCmd.BrowseTo objecttype:=acBrowseToForm, _
-
objectname:="frm_accounts", _
-
PathtoSubformControl:="NavigationForm.navigationsubform", _
-
WhereCondition:="pk_accounts = 5"
I've hard-coded the where condition in this example. I would normally build a separate string "zSQL" and use that string in the "WhereCondition"
Main things to note here:
1) I've named the parent form "NavigationForm"
2) I've named the CONTROL that CONTAINS the actual subform(s) "navigationsubform" --- it is VERY important to understand that this is a control and not the form within that control.
3) The "WhereCondition" will toggle a filter on the form loaded in to the "navigationsubform" (in this case "frm_accounts") so that only the record with the correct value(s) show; thus, if you want to see all of the records simply toggle the filter (on/off) via Ribbon>Home>Sort&Filter>[Toggle Filter]. I have a button on the form itself that will do this because it's more obvious to the end user.
4) [pk_accounts] is the field in the query [Qry_Accounts] bound in part to table [T_Accounts] --- The control on "Frm_Accounts" is "z_ctrl_PK_Accounts" bound to the field [PK_Accounts].
>This is important because if the control has the same name as the underlying field there can be strange errors. Most of the time, this doesn't happen; however, as you get deeper in design the Gremlins take notice of your activities and come to play };-)
Hopefully this will give me the names of your controls etc... that I will need to point you in the right direction.
Z
PS:
You might read thru the links I have here:
https://bytes.com/topic/access/answe...ue#post3769037 if you are going to use the Navigation Control. They will definitely help you avoid some of the more common pitfalls and provide some detail needed to successfully use the control.