PDA

View Full Version : Solved: Max Macro causes form's navigation bar to disappear..



cath_hopes
11-27-2007, 02:47 AM
Hi there,

I've added the MAX macro to the On Open property of my form. It works very nicely - when my form opens it opens to almost a full screen so all the controls etc can be viewed by a user.

Unfortunately, the navigation bar across the bottom has disappeared and I can't see how to retrieve it. As a workaround I've instead created some navigation buttons using the wizard but they don't function as well as the original tool bar, for eg. if you click on new/add record, don't make any changes and then click on first record button, the new record still exists (with blank fields aside from defaults) whereas if I'd used the buttons on the original Access 2007 navigation bar this new record would have correctly disappeared.

Can anyone help me retrieve the navigation bar?
Thanks in advance,
Catherine

Charlize
11-28-2007, 03:46 AM
on the form load event you can try this Me.NavigationButtons = True

cath_hopes
11-28-2007, 04:48 AM
I tried your code within the form load event but it didn't work. Then I tried it within the form current event and it worked once ..!! It has not worked since. Very weird.
By the way, the form's Navigation Buttons property has always been set to yes.

Charlize
11-28-2007, 06:42 AM
What about a call to a seperate module. First this module Sub show_record_navigation(vFormName As String)
Application.Forms(vFormName).NavigationButtons = True
End Sub
and on the form_activate event you do a Call show_record_navigation(Me.Name) ? And what coding do you use for the maximisation of your form.

cath_hopes
11-28-2007, 07:09 AM
No coding for the maximisation of my form, just a simple macro against the on open form event that only contains the action 'Maximise'.

I've tried your code above but it didn't work. Should I substitute vFormName with my form's name?

Charlize
11-28-2007, 08:03 AM
I've tried your code above but it didn't work. Should I substitute vFormName with my form's name?No. Put the

Sub show_record_navigation(vFormName As String)
Application.Forms(vFormName).NavigationButtons = True
End Sub in a seperate module. Like a form, database, query ... you can also add a module that contains procedures and functions that you created. Then on the form_activate event you put this line in it Call show_record_navigation(Me.Name)So Me.Name would contain the name of the active form. When calling the show_record_navigation procedure, the variable vFormName is used to store the name of the active form.

The idea is to use that procedure for every form. If you got 5 forms they can call the same procedure and each form can add those buttons. Otherwise we would have to create 5 seperate subs for every form that could become active to load the navigation buttons.

cath_hopes
12-04-2007, 09:31 AM
I still couldn't get it to work so created my own navigation buttons as a workaround.
Then today I downloaded Office 2003 Service Pack 3 and when I next opened my form, lo and behold, there was the navigation bar!!!
All very odd especially since I am using Access 2007...
Anyway I'll mark this solved for now.
Thanks Charlize for your help.