Hide default Add New Record Button ONLY - How? (2 Viewers)

Local time
Today, 08:02
Joined
Feb 28, 2023
Messages
628
1705497815351.png

Is there any way to keep the standard navigation buttons, but hide the Add New Blank Record button. I know I set Navigation Buttons = No and hide all the buttons, but I would prefer not to do that - it also hides the No Filter and Search buttons, but I could work around that. I have AllowAdditions = No, so the button doesn't do anything, but it is still there and I still get the pop-up.

Alternately, I have custom navigation buttons in the footer (b/c I can hold down the mouse button and auto-scroll) - https://www.lebans.com/recnavbuttons.htm:
1705499757687.png

But if I have to scroll the screen to the right, they disappear. Is there any (easy) way to keep them in the lower left of the window, rather than the form - in which case I could probably live without the Navigation buttons. (I might need to add a No Filter button, but I think I can figure that out ...)

https://www.access-programmers.co.u...rols-visible-when-user-scrolls-a-form.317083/ - One solution is here, but I'm not sure how much work it would involve. For one thing, my nav buttons are designed to be added as a subform, and this would move them to the parent form, for another all of my controls would be on a subform, etc.

Thanks in advance!
 

Attachments

  • 1705497740255.png
    1705497740255.png
    14.3 KB · Views: 22
Last edited:

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:02
Joined
May 21, 2018
Messages
8,529
Pretty sure you have to roll your own. There are lots of examples out there.
 
Local time
Today, 08:02
Joined
Feb 28, 2023
Messages
628
Thanks - I didn't follow through all of the details, but @arnelgp posted a demo in Reply #6 (in your linked thread) that I can probably modify and that uses the method @isladogs mentioned.

Basically, I would just need to modify his example to look like the standard navigation bar and then load my main current main form as a subform.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:02
Joined
Feb 19, 2013
Messages
16,613
I’m putting a demo together to demonstrate the sort of thing you appear to require. On my phone but one way is to use the setparent method to bind the navigation form to the main form (rather than as a subform). The one thing it won’t do is move on scroll (which is a feature I’m developing

off the top of my head, navigation form has to be popup and has a module also set border to none

the code on main form open or load is

1. Create a new instance of the navigation form (which is why you need module to exist)
2. Move and size it to where you want to it to appear on the form
3. Use the setparent method to bind it to the main form

can probably get an example out tonight
 
Local time
Today, 08:02
Joined
Feb 28, 2023
Messages
628
All - there is no immediacy on this. The form I have now has been in use for over 15 years. I just would like to get rid of the standard buttons.

@CJ_London - To make it easier on both of us, what I ideally would like is for the navigation class module to look almost exactly like the standard form navigation bar, but without the new record or find box (and with autoscrolling). So this:
1705502735772.png

With the circled items removed. Ideally, I'd like the scroll bars on the control, but I can live with separate scroll bars like @arnelgp's example.

THANK YOU!!!!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:02
Joined
Oct 29, 2018
Messages
21,473
If you don't want users to add new records on that form, would setting AllowAdditions = No suffice?
 
Local time
Today, 08:02
Joined
Feb 28, 2023
Messages
628
If you don't want users to add new records on that form, would setting AllowAdditions = No suffice?
I did that already. Functionally yes. Aesthetically - no, b/c there is still the grayed out button and the screentip if you hover over it, even though it no longer does anything.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:02
Joined
May 21, 2018
Messages
8,529
Here is another version using a subform and supports the scrolling as @CJ_London describes.
I think there is some logic issues, but appears to work and demos that you can put the subform on all your forms and instantiate with a line of code.
Once you make the subform (fix any logic issues) you can add to all forms and remove the standard navigation. You could add the search feature too.
 

Attachments

  • NavigationControlSubformV1.accdb
    2.3 MB · Views: 58
Local time
Today, 08:02
Joined
Feb 28, 2023
Messages
628
@CJ London - Both ...

What I meant was that if I hold down the Next Record button, it keeps moving. The standard buttons I have to click the button repeatedly to keep going to new records.

I'd prefer the scroll bar in the navigation control, but I can live with it on the detail subform also, if it is complicated to add.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:02
Joined
May 21, 2018
Messages
8,529
You could build in auto scrolling to my demo if you wanted. Need a timer to pause between the next record. You would capture the mouse down and mouse up events to start and stop scrolling. I have never seen an example of that.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:02
Joined
Feb 19, 2002
Messages
43,275
Basically, I would just need to modify his example to look like the standard navigation bar and then load my main current main form as a subform.
Call me crazy but if you like the look of the "free" navigation bar, why roll your own?
 
Local time
Today, 08:02
Joined
Feb 28, 2023
Messages
628
@ MajP - we are talking about different things ...

I want the next record button to scroll through the records - Your demoNavigation with Scroll does that.

I don't need a button to scroll the form on the screen, but I need the controls to stay visible. I don't need or want an Add New Record Button. I have a Search Button and Ctrl-F still works, so I don't need a search box.

Basically:
  • My current database works, but I am using Stephen Leban's navigation buttons, which are on a subform in the footer and disappear if I scroll the form to the right.
  • Your idea does the same thing - except without using a subform, which is cool - but the controls still slide away if I scroll - see attached:
  • ArnelGP has a demo that does basically what I am looking for, but I would have to make my main form into a subform and then called the new main form from my switchboard form, etc.
 

Attachments

  • NavigationControlSubformV1_MajP_wide.accdb
    536 KB · Views: 41
  • customNavigationButton_Arnelgp.accdb
    644 KB · Views: 43
Local time
Today, 08:02
Joined
Feb 28, 2023
Messages
628
Call me crazy but if you like the look of the "free" navigation bar, why roll your own?
As stated initially, three reasons:
  • The "free" navigation bar will not autoscroll through the records. The custom ones will. I.e. I can hold down the Next button and go through ALL the records. I don't have to click to go to Record 2, click again to go to Record 3.
  • I have AllowAdditions = No for the form, but I can't get rid of the grayed-out "New (Blank) Record" button, nor the tooltip when I hover over it.
  • I don't really need the search box on the "free" bar, but I can live with it.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:02
Joined
May 21, 2018
Messages
8,529
I don't need a button to scroll the form on the screen
What we are saying if that if the Form is continuous and you move in the form. You want the navigation to update as you moved in the form. The Navigation needs to control the form and the form needs to control the navigation buttons.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:02
Joined
May 21, 2018
Messages
8,529
ArnelGP has a demo that does basically what I am looking for, but I would have to make my main form into a subform and then called the new main form from my switchboard form, etc
If that is what you want, with any custom bar you will have to do what ArnelGP demos and put your MainForm as a subform.
However what is nice about that approach is that you can build a Consistent "Container" form with all the navigation, open, close, etc in your Container form. Then simply put all your forms inside as a subform. It would give consistency. You would design as if you have a MDI form.
 
Local time
Today, 08:02
Joined
Feb 28, 2023
Messages
628
The form is not continuous - or at least datasheet view is disabled - if that helps. And we use tabbed windows, which basically gives the MDI look.
Main issue is that I'm not sure how much moving the main form to a subform will affect anything with how the form works ...
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:02
Joined
May 21, 2018
Messages
8,529
The form is not continuous - or at least datasheet view is disabled - if that help
Not really it does not maater. In my case and ArnelGP case that functionality is built in so it will work regardless. If you move the form via code it still works.
Main issue is that I'm not sure how much moving the main form to a subform will affect anything with how the form works
The big issue would be if your code calls a form by name. You cannot use Docmd.openform or Forms!YourFormName. That could all
 
Local time
Today, 08:02
Joined
Feb 28, 2023
Messages
628
I think Docmd.openform is only on the switchboard, but there are a LOT of Forms!YourFormName in the various module codes ...
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:02
Joined
May 21, 2018
Messages
8,529
Forms!YourFormName in the various module codes ...
If you were going to make a single MDI form and load all forms as subforms then it may be as simple as replacing

Forms!yourFormName to
Forms!MyMDI.SubFormControlName.Form

Since now all forms resides in the subform control. However, this does seem like a lot of work just to format the nav control. But it may be functionally nice.
 

Users who are viewing this thread

Top Bottom