How to disable text box in the subform under the navigation tab (1 Viewer)

arabude

New member
Local time
Today, 14:01
Joined
Mar 4, 2020
Messages
8
Main Form = frmMAIN
Navigation Dashboard = MainNavControl
Navigation Tabs = tabSEARCH, tabINCOMING, tabEMPSEARCH and so on..
Navigation Sub = subMain (where all the subform is loaded) "navigation target name"

Need some help, I'm working on a "ACCESS 2016" database and used the navigation tab. However I can't enabled the textbox inside the subform (EMPLOYEE) which is link to navigation tab (tabSEARCH), I have search all the kb and still not working. I hope you could help me on this.
 

Attachments

  • navControLProblem.jpg
    navControLProblem.jpg
    263.9 KB · Views: 145

isladogs

MVP / VIP
Local time
Today, 07:01
Joined
Jan 14, 2017
Messages
18,254
Open the subform in design view and click on txtEMPSearch. Now set Enabled=False in the property sheet. Save
 

arabude

New member
Local time
Today, 14:01
Joined
Mar 4, 2020
Messages
8
Open the subform in design view and click on txtEMPSearch. Now set Enabled=False in the property sheet. Save
[/QUOTEt
thanks for your input, i need to do that under vba code
 

isladogs

MVP / VIP
Local time
Today, 07:01
Joined
Jan 14, 2017
Messages
18,254
OK. In a suitable subform event such as Form_Load use
Code:
Me.txtEMPSearch.Enabled=False
If you want to re-enable it later, repeat the code line but use True instead of False
 

arabude

New member
Local time
Today, 14:01
Joined
Mar 4, 2020
Messages
8
OK. In a suitable subform event such as Form_Load use
Code:
Me.txtEMPSearch.Enabled=False
If you want to re-enable it later, repeat the code line but use True instead of False

Thanks for that, I'm aware with that code within the form, what I'm really having trouble is... (see my attachment screenshot) maybe you have some idea how am I going to go over it.
 

Micron

AWF VIP
Local time
Today, 02:01
Joined
Oct 20, 2018
Messages
3,478
Not sure what you mean by "main form" or "navigation dashboard". I think what you want is the syntax for referencing nav form/subform/control:
[Forms]![NavigationForm]![NavigationSubform].[Form]![controlName]

For you it would seem that you have not used the default nav form or subform container name, so perhaps
[Forms]![MainNavControl]![subMain].[Form]![YourcontrolName]
 

arabude

New member
Local time
Today, 14:01
Joined
Mar 4, 2020
Messages
8
Not sure what you mean by "main form" or "navigation dashboard". I think what you want is the syntax for referencing nav form/subform/control:
[Forms]![NavigationForm]![NavigationSubform].[Form]![controlName]

For you it would seem that you have not used the default nav form or subform container name, so perhaps
[Forms]![MainNavControl]![subMain].[Form]![YourcontrolName]

Appreciate your response, indeed that's what i want to do.. [Forms]![MainNavControl]![subMAIN].[Form]![txtInitial].Enabled = True
I got an error 2450.. it looks like it can't find the subform... kindly see my screenshot
 

Attachments

  • Run-timeError 2450.JPG
    Run-timeError 2450.JPG
    18.5 KB · Views: 119
  • navControLProblem.jpg
    navControLProblem.jpg
    263.9 KB · Views: 155

Micron

AWF VIP
Local time
Today, 02:01
Joined
Oct 20, 2018
Messages
3,478
Use the syntax I gave you and substitute your correct names since, as I mentioned, I was guessing at what the names are. Your navigation form name should be easily determined by what is shown in your navigation pane (where all the tables, queries, etc are listed). If you don't know the name of your navigation subform control, then you likely didn't alter the default name for that either. If you did, or just want to confirm, click on the container control that holds the subform that gets loaded when you click on a tab (see orange outline and note name of control in drop-down). To further explain the use of the syntax:
Name of navigation form is "Navigation Form" if you kept the default name.
"NavigationSubform" (typically the default name given by Access) refers to the subform control that holds the forms. Again, that may or may not be the name.
Control name is the name of the control you want to reference.

I don't use nav forms so what little I know is for helping others solve the problems they create. Note that you cannot use this reference in tab code because one form unloads and the next opens when you switch tabs. Nor can you use it to reference controls on the form that is either opening or closing.
1583368299062.png
 

arabude

New member
Local time
Today, 14:01
Joined
Mar 4, 2020
Messages
8
Use the syntax I gave you and substitute your correct names since, as I mentioned, I was guessing at what the names are. Your navigation form name should be easily determined by what is shown in your navigation pane (where all the tables, queries, etc are listed). If you don't know the name of your navigation subform control, then you likely didn't alter the default name for that either. If you did, or just want to confirm, click on the container control that holds the subform that gets loaded when you click on a tab (see orange outline and note name of control in drop-down). To further explain the use of the syntax:
Name of navigation form is "Navigation Form" if you kept the default name.
"NavigationSubform" (typically the default name given by Access) refers to the subform control that holds the forms. Again, that may or may not be the name.
Control name is the name of the control you want to reference.

I don't use nav forms so what little I know is for helping others solve the problems they create. Note that you cannot use this reference in tab code because one form unloads and the next opens when you switch tabs. Nor can you use it to reference controls on the form that is either opening or closing.
View attachment 79587

I really appreciate your patience on this, the syntax you gave, still not giving me to be able to disable the textbox on the EMPLOYEE FORM under the Navigation tab [navEMPSEARCH], done playing around with the code below.... i hope the screenshot will help you to figure out my problem...

[Forms]![MainNavControl]![subMAIN].[EMPLOYEE]![txtGrade].Enabled = True
[Forms]![Main]![MainNavControl]![subMAIN].[EMPLOYEE]![txtGRADE].enabled = true
 

Attachments

  • navControLProblem2.jpg
    navControLProblem2.jpg
    194.1 KB · Views: 127

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:01
Joined
May 7, 2009
Messages
19,246
as far as I know, you can't enable/disable any control from a subform which is not Currently loaded.
as mr.collin's suggested, do it on the design view of the form/subform.
Navigation subform are Dynamically loaded whenever you click on the corresponding Tab for that subform.
that is why you will notice that the cursor is always on the first record of that subform.
 

arabude

New member
Local time
Today, 14:01
Joined
Mar 4, 2020
Messages
8
as far as I know, you can't enable/disable any control from a subform which is not Currently loaded.
as mr.collin's suggested, do it on the design view of the form/subform.
Navigation subform are Dynamically loaded whenever you click on the corresponding Tab for that subform.
that is why you will notice that the cursor is always on the first record of that subform.

Thank you arnelgp, i understand what you mean, i agree with you, i can disable the control in the subform if you are in the design mode.

What I'm looking at is to disable the control if you are in another form for example upon logged in to "LOGIN FORM" the code must disable the control "textbox" which is in the "MAIN FORM" however it has a dashboard of navigation tabs and under the navigation tab "tabEMPSEARCH" there the control textbox that i need to disable... i hope someone can help me on this...
 

Micron

AWF VIP
Local time
Today, 02:01
Joined
Oct 20, 2018
Messages
3,478
So the control you want to disable is on a form that is not open at the time? That is not possible, and as I've already pointed out, only 1 form is ever loaded into a navigation form at one time. It might look like you are "switching" from one form to another, but you are not. You are closing one and opening another when you select a different tab.

However, you're coding for [MainNavControl] yet your picture seems to indicate it is called navEmpSearch??
Please go back and review what I wrote about how to determine what the names of these things are.

EDIT- just noticed in my email one thing that you did: the parts in bold are not to be substituted with anything

[Forms]![MainNavControl]![subMain].[Form]![YourcontrolName]
 
Last edited:

arabude

New member
Local time
Today, 14:01
Joined
Mar 4, 2020
Messages
8
So the control you want to disable is on a form that is not open at the time? That is not possible, and as I've already pointed out, only 1 form is ever loaded into a navigation form at one time. It might look like you are "switching" from one form to another, but you are not. You are closing one and opening another when you select a different tab.

However, you're coding for [MainNavControl] yet your picture seems to indicate it is called navEmpSearch??
Please go back and review what I wrote about how to determine what the names of these things are.

Yes, technically the [MainNavControl] is the name of the navigation control dashboard where all the tab is located and [navEmpSEARCH] is one of the navigation button place inside the [MainNavControl]. before we get into the navigation button with navigation target name subform "EMPLOYEE" ....

I have a supervisor login form that authorize the editing of record then after the authentication process it should enabled all the "textboxes" for editing which is under the navigation button [navEmpSEARCH] with subform "EMPLOYEE"

I'm very sorry for my problem, I'm working on this for almost a week and I can't find the right answer... I hope someone could help me on this...
 

Attachments

  • navControL-Issue.jpg
    navControL-Issue.jpg
    278.9 KB · Views: 139

Micron

AWF VIP
Local time
Today, 02:01
Joined
Oct 20, 2018
Messages
3,478
You're confusing me with "dashboard". That is a specific type of form, one that I don't ever recall using in a practical application. So now is it a dashboard or is it a navigation form?
The navigation buttons don't enter into this if it's a navigation form, so forget those. They're just a kind of 'button'.
I updated my last reply. If that doesn't help, then maybe you should post a copy of your db as we don't seem to be getting anywhere fast.
 

arabude

New member
Local time
Today, 14:01
Joined
Mar 4, 2020
Messages
8
So the control you want to disable is on a form that is not open at the time? That is not possible, and as I've already pointed out, only 1 form is ever loaded into a navigation form at one time. It might look like you are "switching" from one form to another, but you are not. You are closing one and opening another when you select a different tab.

However, you're coding for [MainNavControl] yet your picture seems to indicate it is called navEmpSearch??
Please go back and review what I wrote about how to determine what the names of these things are.

Yes, technically the dashboard name is [MainNavControl] where all the navigation button is place and one navigation button is [navEmpSEARCH]

Actually, I have a supervisor login form that will allow to edit employee record which is under the navigation button [navEmpSEARCH] and this is pointing to navigation target name [EMPLOYEE] which is the subform link to the navigation button [navEmpSEARCH].... I'm having some difficulties to enable the "textboxes" or to pass the code to the subform [EMPLOYEE]
 
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:01
Joined
Aug 30, 2003
Messages
36,129
FYI, I moved this to a more appropriate forum. Welcome to AWF.
 

Micron

AWF VIP
Local time
Today, 02:01
Joined
Oct 20, 2018
Messages
3,478
So it seems you want to pass a value from one navigation subform to another. I believe that you can use the Navigation Where clause for that. As I think I pointed out, I haven't used a nav form to any great extent so all I can do is point you in that direction.
 

Users who are viewing this thread

Top Bottom