473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to open a record inside a horizontal tab with a subform in it.

2
Dears
I am trying to reach the student ID within a form called studentsFrm embedded in a horizontal tab of the main form called Home.
So from outside the form, I need to call for a student number x and then the studentsfrm will go to this record.
Home form is open but the search for the student ID ( number ) is from outside the form , from another form.
thanks in advance.
long story short, I am trying to open the "home" form, main, which contains the subform called studentsfrm but to open directly into a specific student ID.

NB: I was trying to work with browseto I couldn't manage to find the right syntax, stuck in an run time error 6054, a valid path argument is of the form : Mainform1.subform1:form1.subform1
thanks a lot in advance

all the best
Zee

Attached Images
File Type: jpg Capture.jpg (52.4 KB, 528 views)
Jun 17 '16 #1

✓ answered by zmbd

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:
Expand|Select|Wrap|Line Numbers
  1.     DoCmd.BrowseTo objecttype:=acBrowseToForm, _
  2.         objectname:="frm_accounts", _
  3.         PathtoSubformControl:="NavigationForm.navigationsubform", _
  4.         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.

1 1474
zmbd
5,501 Expert Mod 4TB
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:
Expand|Select|Wrap|Line Numbers
  1.     DoCmd.BrowseTo objecttype:=acBrowseToForm, _
  2.         objectname:="frm_accounts", _
  3.         PathtoSubformControl:="NavigationForm.navigationsubform", _
  4.         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.
Jun 24 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Alain Guichaoua | last post by:
Good evening to all Here is my problem : I have a form with a subform. They are linked. When I open the form I would like the subform to reach its last record. I tried the method...
4
by: YFS DBA | last post by:
How do I use VBA to insert a *new* record into a subform? I have a master form with client information, and a sub form with billing information. I want to click on a button ("Add Data") and have...
3
by: Uwe Range | last post by:
Hi to all, I am displaying a list of records in a subform which is embedded in a popup main form (in order to ensure that users close the form when leaving it). It seems to be impossible to...
6
by: Allan Koch | last post by:
Dear NG, I would like to format a record in a subform, dependent on a value in one field. If one field in the record I show in a subform (datasheet view) is true I like to view that particular...
1
by: sixsoccer | last post by:
I have built a database with a <Mainform> and a <Subform>. My problem is twofold. 1. My subform is set as a continuos form with AllowAddiotions set to NO (ie. a list of Issues to the client on...
3
by: kevin.jonas | last post by:
What is the line of code to select the first record of a subform? I have a form with two subforms. What you select in one subform controls what is queried in the second subform. however when the...
1
by: planetthoughtful | last post by:
Hi All, I have a mainform with a subform in which I show some task summary data. On the mainform I have a number of unbound controls that reflect values relevant to each task in the subform....
7
by: FNA access | last post by:
I have a mainform that has a subform in the detail section and a subform in the footer section.(Both subforms are in datasheet view) When I click the navigation button to create a new record on the...
1
by: stuart | last post by:
I have a list of records in a subform that a user can either edit or delete. This is an unbound form. If the user deletes a record, I want to refresh the form, and then position the cursor on the...
11
by: Adrian | last post by:
Dear Gentlemen, I,am a newbie for access and still learning on progress. I develop a small database called a Purchase Orders Log and I wanted to filter some certain records in a subform which is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.