Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Access Forms _ Navigation Form

Posted by: payfast8898 May 23 2019, 01:53 PM

Does anyone know how to simulate a pressed key on a navigation form?
I have a series of forms a client has to fill out and I have it setup so they can go to the next tab without lifting the mouse and keeping hands on the keyboard.
I have no problem changing the subform however the tab keys stay the same color.
I can program the tab keys to change color however the pressed one still stays the same color. the client wants to be able to follow the screen by looking at the tab color.
so it there a way to change the pressed key so one goes back to original color and the other one goes to pressed color.

Thanks for checking this out

 

Posted by: theDBguy May 23 2019, 02:02 PM

Hi. I haven't tried but would setting the focus to the desired tab change its color?

Posted by: gemmathehusky May 23 2019, 02:46 PM

With controls you normally use the got focus/lost focus to modify the appearance.

Their doesn't seem to be that option with a tab control, although the active tab shows a different colour in the header. If you move to a control on a tab, doesn't that page automatically
become selected?


I am talking about a tab control, rather than the "navigation form", which seems like a new construct to me?

Posted by: payfast8898 May 24 2019, 01:07 AM

DBguy no it don't and gemmathehusky no, after it gets the focus you have to hit the enter key

Posted by: gemmathehusky May 24 2019, 05:48 AM

out of interest, then how do you use keyboard only to navigate to a different tab.
Can you show us the code you are using? Are you just pressing the tab key, or something else.

I originally thought you were talking about a tab control within a form. You aren't are you? You are talking about separate forms presented as tabbed documents rather than overlapping.

so if you don't select a control on a form, to give that form the focus (and thereby change the selected tab) how do you expect it to happen?

Posted by: missinglinq May 24 2019, 06:53 AM

Yes, Dave, the Navigation Form is a new thing...added as of v2010, I believe...and much like the old Switchboards, generally eschewed by experienced developers...much for the same reasons.

While added to make the task of easily letting your fingers do the walking thru your database...it generally makes almost all other tasks more complicated!

The biggest negative, with the Navigation Form, is that all of the Forms on it have to be treated as Subforms, will all that this entails. As with the Switchboards of days past...most developers prefer 'rolling their own.'

And I'm pretty sure that we aren't, in fact, talking about Subforms on a Tabbed Control...but the normal presentation of Forms on the Nav Form.

Of course, I'm confused about even going to the trouble of writing code to switch Forms without using the mouse! Even in a production data entry situation, it seems to have little real advantage.

Linq ;0)>

Posted by: gemmathehusky May 24 2019, 07:28 AM

I had never seen the navigation from before - I just noticed it as a tool on the A2016 toolbar.

In that case, How is the navigation from different from selecting "tabbed windows" rather than "overlapping windows" in the access options?

Posted by: payfast8898 May 24 2019, 08:27 AM

I have manually made them for years, they basically open subform so I can open hundreds of forms without ever leaving the main navigation form. the data entry our clients do it is a lot better for them and stuff don't look like its really opening and closing if that make sense.

Posted by: Minty May 24 2019, 08:43 AM

@Dave - The inbuilt navigation form loads it's target forms as Sub forms within the Navigation form, but effectively only uses one sub-form container and swaps the forms in and out.
It's clever, but very confusing to the uninitiated if you think the other forms are still open, and want to reference something on them.

It also makes writing sub form references a nightmare, as you are effectively already one subform level in, but don't necessarily realise it.

Posted by: payfast8898 May 24 2019, 09:42 AM

Ok after playing around this is what I came up with.

CODE
Forms![PatientSwitchboard].[NavigationButton69].SetFocus
Sendkeys "{Enter}"


As I said I had no problem changing content but had to find a way to press the button so on press color would change. I hate using the sendkeys but seems to work perfect. Set focus to the button and hit enter using the send keys, if someone knows how to do it without using send keys I would like to try that thanks.

Posted by: theDBguy May 24 2019, 09:44 AM

Hi. Congratulations! Glad to hear you found a solution. Coincidentally, I just played with it as well and was able to use the BrowseTo command (on a button) to make it work. Cheers!

Posted by: payfast8898 May 24 2019, 09:55 AM

DB I tried the browse to which brought up the subform no problem but didn't change the button status, how did you get it to change can you share the code please?

Posted by: theDBguy May 24 2019, 10:08 AM

Hi. Since I had no idea how you're moving from one tab to another without using the mouse, I just used a button, and here's the code I used in the Click event.

CODE
Private Sub Command11_Click()
DoCmd.BrowseTo acBrowseToForm, "Form2", "Navigation Form.NavigationSubform"

End Sub
This changes the subform and highlights the button associated with it.

Posted by: payfast8898 May 25 2019, 09:40 AM

The button is on the subform that they are entering on and when comes to the last field go's to the next button and they hit enter and should go to the next tab. it's not on the same form or I wouldn't need the button they could just hit the tab. how can we change your code to work with that?

Posted by: theDBguy May 25 2019, 10:06 AM

Hi. Thanks for the clarification. So, I moved my button to a subform, and it still worked without changing the code. Give it a try and let us know what happens.

Posted by: payfast8898 May 25 2019, 10:30 AM

Maybe it would help if I knew what form was what in your code, what is the subform name and main form name, I could be doing something wrong I keep getting invalid path. thanks

CODE
DoCmd.BrowseTo acBrowseToForm, "Form2", "Navigation Form.NavigationSubform

Posted by: theDBguy May 25 2019, 10:50 AM

Sure... So, "Form2" is the name of the form loaded in the second tab of my Nav Form. "Navigation Form" is the name of my Nav Form (I just used the Wizard to create it, so this is the default name assigned by Access). And "NavigationSubform" is the subform container where "Form2" is displayed when I click on the second tab on my Nav Form (again, this is the default name assigned by the Access Wizard when I created the Nav Form). Does that help?
So, if I click on Tab 1 of my Nav Form, I see "Form1." If I click on Tab 2 of my Nav Form, I see "Form 2". If I click on Tab 3 of my Nav Form, I see "Form3." On "Form3," I put the button I described earlier (it used to be on the Nav Form itself). When I click this button on "Form3," Tab 2 gets highlighted and the Nav Form loads "Form2."

Posted by: payfast8898 May 25 2019, 12:22 PM

ok your space was messing me up, I was hoping that was what I was missing, however this I have done already and as I said mine changes the sub form fine but it don't highlight my tab the original one keeps pressed. I wonder if the form's have to be the same name as the buttons or something like that?

Posted by: theDBguy May 25 2019, 12:36 PM

Hi. As I said, I used the Wizard because I just wanted to do a quick test for you. How exactly did you create your Nav Form?

Posted by: payfast8898 May 25 2019, 12:38 PM

I changed names and that didn't help, mines just not firing the color changing I do believe it is changing the tab position so it is working on that part just not changing the coloring. so don't worry about it what I have works great with not much coding thanks for looking into it I appreciate it.

Posted by: payfast8898 May 25 2019, 12:44 PM

I used the wizard to start it and just changed the name of the navigation page, sub page has same name etc. I have been making my own Navigation pages like this for 20 years this year so was happy when they came out with this give me a lot more options with less programming just have to learn a couple of the ins and outs of the new stuff. what I did seems to work I'm scared trying the other way may work on some and not others hate using the send keys some of them shut off the number lock but the enter key don't seem to have any issues that I can see.

Posted by: theDBguy May 25 2019, 12:50 PM

Oh, okay then. Guess we'll just have to leave it alone for now. But just to confirm it, when you get a chance, try creating a test Nav Form on an empty db and see if really works or not. Maybe there's just something special about your other database. The first test I did yesterday, where I had the button on the main form, was created at work. I had to create a new one today from Home, so I could test the button on a subform. Good luck!

Posted by: payfast8898 May 25 2019, 01:07 PM

I just did and no luck I also tried it on a clients machine with no luck I did see some post that other people had the same issues. seems to fire everything accept for the colors for some reason, if I wave my mouse over it after I fire it the colors change to what they should be. nothing fancy and I created a blank one to test. send me yours and I can see if it is just office 365 access or not. I just put on another client and no luck.

Posted by: theDBguy May 25 2019, 01:17 PM

Okay, I had to create a new one to make sure it's clean. The one I have been using included some other tests I was doing for others. Please try the attached and let me know if it doesn't work for you. It works fine for me.


 NavPane.zip ( 28.87K ): 4
 

Posted by: payfast8898 May 25 2019, 04:18 PM

ah sorry I thought you looked at the image I sent up, mine is the vertical one and yes the horizontal one works on yours but when I made one vertical yours didn't work anymore

Posted by: theDBguy May 25 2019, 08:17 PM

LOL. Sorry for the misunderstanding. Iíll let you know if I discover anything else. Cheers!

Posted by: theDBguy May 27 2019, 10:45 AM

Hi. I went ahead and modified my demo to use a vertical nav form. Please take a look and let me know if this will work for you. Thanks.


 NavPane.zip ( 30.12K ): 4
 

Posted by: payfast8898 May 27 2019, 06:42 PM

Sorry again I use both if you look at the image. my fault I should have explained better but I have the top one that controls the left ones. what you have will not work that way either I tried that too.

Posted by: theDBguy May 27 2019, 07:59 PM

I see. I think for me to go any further in helping figure out a better solution, it would be your time to post a demo version - one that represents your setup very well. Thanks.

Posted by: payfast8898 May 28 2019, 09:13 AM

sorry I thought the picture would be enough to explain what I was doing. I uploaded your file with the same setup I'm using. As I said I do have a solution if you don't want to waist anymore time to this but if you want to thanks

 NavPane.zip ( 38.12K ): 6
 

Posted by: theDBguy May 28 2019, 09:42 AM

So, how come the file you just posted works for me? I click on Form3 tab, then click on the button, and the Form2 tab gets highlighted.

Posted by: payfast8898 May 28 2019, 10:02 AM

You tell me I have tried this file on at least 5 other computers that have access 365. what version are you using? we are having no luck

Posted by: theDBguy May 28 2019, 10:10 AM

Hi. I'm using Access 2016 (Desktop Version). When I get home tonight, I'll try to create a movie to show what's happening on my end.

Posted by: payfast8898 May 28 2019, 11:02 AM

I believe you just not happening over here. other people have had same issues too, just random maybe I don't know.

Posted by: theDBguy Jun 1 2019, 01:02 PM

Hi. Understood. But for what it's worth, here's a video of what I see on my end.


 2019_06_01_10_58_50.zip ( 126.19K ): 5