Default the 'expansion' button on a grid

Open the form, click on Tools > Customize > Add Current Window to Visual Basic

Then click on Tools > Customize > Add fields to Visual Basic.

The cursor will change shape. Click on the 'expansion' button. Click on Tools > Customize > Add fields to Visual Basic again to cancel the add functionality (you're supposed to be able to hit 'escape' to exit, but it doesn't always work)

Click on Tools > Customize > Visual Basic Editor to open the VBA Editor

Choose 'Window' in the top left dropdown, and 'BeforeOpen' in the top right dropdown.

Enter the code shown.

That should do it. Comments?

 

 

 


 
 

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences