Hide default Add New Record Button ONLY - How? (1 Viewer)

More updates - I think this will be simple ...

First off, I tried adding Me.Move Me.WindowLeft and the API call to my subform in the Enable/Disable Buttons() subroutine, which is called from the FormCurrent() procedure of my main form. It doesn't work.

There is a glitch where when I disabled the form Navigation buttons, I still saw the space for the scrollbar but the code here fixed that issue:

Now, I am using a rectangle to make my navigation form appear to be a "bar" rather than a control.

If the form is wider than the screen, it works fine except the buttons scroll:
1705928940967.png


1705929020067.png


However, if the form is smaller than the screen - no scrollbar needed, I get this:
1705929157851.png

Questions:
  • First, is there any way to "extend" the rectangle? Right now, it stops at the border of the form. If I make it longer, it increases the form width - i.e. the form is roughly 16-inches. If I make the rectangle stop at 18-inches, the form size increases to 18-inches and I will end up having to scroll the form just to see the end of the rectangle. (i.e. is there any way to set the rectangle width to the form width, regardless of display resolution.
  • Second - is there any way to center the navigation subform in the window footer? If I do this, the scroll setting will not matter - i.e. If I move the navigation subform over 3 inches, it means the buttons likely won't move offscreen, but at VERY low resolution, they might be off to the right of the screen.
Thanks and regards!
 
Somewhat solved - If I put the following code in Form Resize, it fixes the gap:
Me.zz_frmNavButtons.Width = Me.InsideWidth
Does NOT work if I resize the form, but works if I open it with Access sized down or with Access Maximized. I might move it to Form Current of some other procedure.

I no longer need the rectangle in the footer.

I can "fake" question two by adding a couple of inches to the left of the zzfrmNavButtons - won't stay centered and won't be perfect, but should keep the buttons on-screeen.
 
Current status - Moved the width setting to Form Open code, added 6-inches of space before the nav form.

Is not centered and still gives a gap if I open full-screen and size down, but works fine if I open the form sized down or if I open maximized.
Maximized:
1705931601477.png

Reduced down and scrolled left:
1705931698606.png

Reduced down and scrolled right:
1705931755478.png
 
Last edited:
Made a slight change to the form and can't get it quite working correctly.

I wanted the navigation indicators centered in the bottom of the form.

I backed out the 6-inches of spacing on the left and set the form width to 3.05 inches.

Then I added this code, which is working (in Form Open, but I also tried it in Form Current):
Me.zz_frmNavButtons.left = (Me.InsideWidth / 2) - (1.525 * 1440)

Now, I wanted it to look like a statusbar, so I added a rectangle of the same size and color and called it FooterBanner.

I added this code:
Me.FooterBanner.left = 0
Me.FooterBanner.Width = Me.InsideWidth
Me.zz_frmNavButtons.left = (Me.InsideWidth / 2) - (1.525 * 1440)

It is working if I don't need to scroll, but not if I do:
No Scrolling:
1705948343535.png

Scrolling - note gap on right:
1705948428464.png

Any idea what I need to change to fix it?
 
This doesn't work either - and seems to leave the same amount of blank space:
Me.FooterBanner.left = 0
Me.FooterBanner.Width = (Me.InsideWidth / 2) - (1.525 * 1440)
Me.zz_frmNavButtons.left = (Me.InsideWidth / 2) - (1.525 * 1440)
Me.zz_frmNavButtons.Width = (Me.InsideWidth / 2) + (1.525 * 1440)

Also, I think it is clear, but ...
First code is supposed to put the left edge of the navigation form at the center of the window, minus 1/2 the width of the navigation form. FooterBanner is supposed to be the entire width of the window.

Second code is supposed to put the left edge of the navigation form at the same location, but change the width of the navigation bar to 1/2 the width of the navigation form, plus 1/2 the width of the window, which should take it to the right edge. The footer banner should go to the start of the navigation form, which it does.
 
Also - Reply #43 is incorrect, but I don't understand what is happening.

One of the form's works the way I want - the navigation panel seems to take up the entire screen regardless of what the size of the window is. My other forms, which are not the same size, have the gap on the right if the form is wider than the window size, but it doesn't matter which from I open first and the startup code is the same.
 
Posting a demo database. Two things I noticed, but I'm not sure if they cause the problem. In some cases, my FooterBanner rectangle kept the form width, so, if my form was 16.5-inches wide, the FooterBanner would increase to 16.5-inches, and a later form, which would have been 15.8 inches, would now be 16.5-inches wide to accommodate the FooterBanner width, but I'm not sure that is the only error.
 

Attachments

Have a new issue and I'm adding an example database.

In the example database, when I open a form, I have to click TWICE on the next button before the database goes to the next record. After that, it seems to work properly.

We made two changes to the Form Load procedure:
  • We were having an issue with HD Monitors and an Error 2100: The control is too large for this location. I used some of @isladogs code to determine the monitor resolution and sized to 30000 Twips to compensate on HD monitors. (The limit is supposed to be 32767 Twips, but we found we still got the 2100 error at 32000, but did not at 31000, so we used 30000 to keep some cushion.)
  • We added user "groups" so the data in the table is filtered depending on the Group that the user belongs to.
If I comment out either change and leave the other one, the error does not occur - but obviously the database either doesn't display the correct records or errors on HD monitors.

Swapping the order of the commands didn't make a difference (doing the filtering prior to checking for HD monitors.)

Adding Call Me.zz_frmNavButtons.Form.EnableDisableButtons to the Form_Open event in addition to Form_Current didn't help either.

Thank you in advance.
 

Attachments

Anyone have any ideas on Reply #49. @isladogs? @The_Doc_Man?

I did some more testing and I somewhat see what the issue is, but not why or how to prevent it.

I moved the banner width control to Form_Resize and I still see the issue.

Then I added msgboxes for Open in Form Open, Resize in Form Resize, and Current in Form Current.

I noticed that the Current msgbox comes up twice, and I think that is why the two clicks are initially required before the record changes.

If I comment out the "Group1" code and re-open the form, "Current" only displays once and the form works normally.

Actually, if I comment out the Me.Requery lines, it seems to work properly, but I don't know if this is a good idea?
 

Users who are viewing this thread

Back
Top Bottom