Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Reducing the size of the tab control works (as you discovered yourself), however there is an alternative workaround: </p> <ol> <li>Add a command button and align it with the top left corner of the tab control </li> <li>Set its Tab Stop property to No (in the 'Other' tab of the command button property sheet)</li> <li>Send To Back to put the command button behind the tab control</li> <li>In the Form's <code>OnOpen</code> or <code>OnLoad</code> event, call the <code>.SetFocus</code> method on the command button</li> <li>Use <code>SendKeys</code> (I know, I know...) to tab to the Tab Control</li> </ol> <p>Sample code:</p> <pre><code>Private Sub Form_Open(Cancel As Integer) Me.HiddenCommandButton.SetFocus SendKeys "{Tab}" End Sub </code></pre> <p>Explanation of the above steps:</p> <ol> <li>This allows you to dictate to Access where it should line up the form on screen.</li> <li>Setting the Tab Stop to No for the command button prevents users from accidentally tabbing to it and causing confusion.</li> <li>Sending the button to the back hides it from the user and prevents it from interfering with any mouse clicking. </li> <li>Setting focus to the command button at form start up is necessary since we turned off the Tab Stop property in step 2.</li> <li>Using SendKeys (always a last resort, and for good reason) to simulate a tab press provides "keyboard focus" to the Tab Control (as long as the tab control is the first control in the tab order for whatever section of the form the control is a part of).</li> </ol> <p><strong>Miscellaneous Notes</strong>: At the asker's request I am including a couple of comments as part of the answer itself:</p> <blockquote> <p><em>@mwolfe</em>: One final note on SendKeys...it blows up under UAC in Vista/Win7. If you can live without the keyboard focus, I'd say leave SendKeys out entirely. If you need it you'll either want to add error handling to ignore the error (if you don't mind some of your users losing keyboard focus functionality) or bypass SendKeys and use the WinAPI directly. Karl Peterson offers a turnkey solution here: <a href="http://vb.mvps.org/samples/SendInput" rel="nofollow">vb.mvps.org/samples/SendInput</a> I have never used it so can't comment on its reliability, but Karl is a Microsoft MVP so he's get some credibility.</p> <p><em>@Roman Glass</em>: mwolfe02 I trust you in that this method will work, but the focus is crucial for me AND some users are working under Windows 7. I will drop this issue for the moment to find out about the user reactions. Nevertheless I think your solution deserves a solved. In the end I have to talk with the WinAPI. Maybe you can edit your answer to include this comment directly. Thanks!</p> </blockquote> <p>For those who may find this answer in the future, please take note that Step 5 above is only necessary if you need the tab control to receive keyboard focus (a critical requirement for the original asker). If you can live without it, I would suggest that you do.</p> <p><strong>UPDATE</strong>: As David Fenton points out in the comments, you can use <code>Ctl</code> + <code>Tab</code>/<code>Ctl</code> + <code>Shift</code> + <code>Tab</code> to move back and forth between the tabs. This is consistent with most tabbed interfaces (eg, browsers) and eliminates the need to use <code>SendKeys</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload