468,770 Members | 2,383 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,770 developers. It's quick & easy.

Access 2010 Navigation Forms DoCmd.BrowseTo Issue

hyperpau
184 Expert 100+
Hi All,

It's nice to be back.
I just got my hands on Access again and I was surprised that the magic is still there.

However, the new Navigation Forms in 2010, replacing the switchboard, is new to me. Nevertheless, I figured it out right away, except with one issue.

I can't seem to get the acDataMode to work!
No matter what I choose, acFormEdit, acFormAdd, asFormReadOnly, etc, access seem to ignore this and just simply browses to the form in normal mode.

Googled every possible keyword combination but I have found nothing. Not even on the MicroSoft site.

What am I supposed to do?
Am I missing something?

Expand|Select|Wrap|Line Numbers
  1. DoCmd.BrowseTo acBrowseToForm, "frmEmployee", "Main.NavSub", , , acFormAdd
Please help me. I am pulling my hair on this last piece of my program.

Thanks in advance. I hope the masters, like NeoPa, would be able to read this and help me out once again.
Mar 5 '14 #1
7 8545
topher23
234 Expert 100+
What is the context in which you're using this command? FWIW, I only know of two "issues" with BrowseTo. First and foremost, the form needs to be open in order for it to work (it isn't an implicit OpenForm). Second, if you are running data from a form and just trying to change the data mode of a subform on that form, entering the Path statement can cause it to fail. I think it's more likely that the second one is your issue, but without any other context I don't have a specific answer.
Mar 5 '14 #2
hyperpau
184 Expert 100+
Hi topher! Thank you very much for your attention.

You are correct. My concern is the second one.
The forms are already preloaded on to the different nav tabs of my nav form, so 'the form needs to be open in order for it to work' is covered. :)

So my issue really is that I want to change the data mode of my Form.

SO basically, the setup is this.

Main Form with a NavigationSubform

Inside the Navigation Subform, I have my forms frmEmployees, frmEvents, and frmModules preloaded.

I have a button on the Main Form which says 'Create New Employee record'.

What I want is that if I click that button, I want to browse to the Nav tab where frmEmployees is loaded, but I want to go there in Data Entry Mode.

What happens is that my acFormAdd is being ignored.
I am still routed to the right tab but I end up on the first record of the form. The frmEmployees does not have any subform. so basically, it's like MainForm.NavigationSubform > frmEmployees

How can I make the Data Mode work? Thanks.
Mar 6 '14 #3
topher23
234 Expert 100+
Since it's the second issue, try just using
Expand|Select|Wrap|Line Numbers
  1. DoCmd.BrowseTo acBrowseToForm, "frmEmployee", , , , acFormAdd
For some very strange reason not addressed by Microsoft, the PathToSubFormControl variable seems to override the DataMode. So, although it's not intuitive to leave the Path variable blank, it should fix the DataMode. Let us know if that solves the problem.
Mar 7 '14 #4
hyperpau
184 Expert 100+
Hi Topher,

The suggestion you gave works but it is not what I'm looking for.
What it did is it closed my Navigation Form and opened the frmEmployees in DataEntry mode, as if I used DoCmd.OpenForm.

What I wanted is to go to the Employees tab of my Navigation Form on DataEntry mode.

However, I found a workaround.
I deleted all pre-loaded forms on my Navigation Form's tabs and just left out 1 tab.

Now, the BrowseTo method simply loads my desired form onto the tab and the Data Mode loads correctly.
If I call on other forms using the BrowseTo method, it simply replaces the current form in the NavSub with the new form I call for.

It gets the job done, although I really wanted to have the forms already loaded on other tabs of my Nav Form.
Anyway to have this done? Thanks.
Mar 8 '14 #5
topher23
234 Expert 100+
I realized that the method I gave you (not giving the path) is actually a solution for when you call BrowseTo from inside the subform. However, I think I see now what the real issue is. When you specify the path to the subform, the BrowseTo statement expects a change in the SourceObject. However, since you're calling out the same form that is already loaded, it's not re-opening the subform in the new DataMode. The only way I can think of to change the DataMode in the way that you want is to first clear the SourceObject by using
Expand|Select|Wrap|Line Numbers
  1. Forms!Main!NavSub.SourceObject = ""
and then using your BrowseTo statement to refill the subform with the proper DataMode.
Mar 11 '14 #6
hyperpau
184 Expert 100+
The problem with this is that it changes the SourceObject of whichever is the active tab on the Navigation Form. Not really the Tab where that form is already pre-loaded.

So basically, it just acts the same way as deleting the tabs, and just having one tab in my Nav Form.
Mar 12 '14 #7
zmbd
5,400 Expert Mod 4TB
hyperpau

The problem is that the ACC2010 Navigation control is a new beast that is poorly documented:

Please read the following threads, I cover some of the aspects of the Navigation Control that you are haveing issues with -

Other than this first one, in no particular order:
[*]http://bytes.com/topic/access/answer...gation-control
>>(1) The navigation control, despite appering as a tab control really is not; therefor, the information contained within the article you posted to does not pertain.
[*]http://bytes.com/topic/access/answer...nt-tab-clicked
>>Read "Best Answer"
>>The remaining thead has some context on the control
[*]http://bytes.com/topic/access/answer...gation-control
>>THis will show you just how bad a lot of the reference material available on this control was (and to a great degree still is) when trying to learn the control. Also a simple solution to a complex question.

[*]http://bytes.com/topic/access/answer...-dialog-window
>> A work around for something you might run into, just keep this handy... it also has a few other links.
[*]http://bytes.com/topic/access/answer...ntrol-subforms
>>Read post #2 and Post#4 - I really should merge these two (^_^)

and I hope that this google-search return works the way it's supposed to as there are other threads here that cover this information too:
https://www.google.com/search?hl=en&...72.IgXDq15QtDE

I'm updating an old frontend to use this new control; thus, I've learned a lot about it thru the school of hard knocks. Any further questions let us know.
Mar 13 '14 #8

Post your reply

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

Similar topics

reply views Thread by zhoujie | last post: by
1 post views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.