View Single Post
 
Old 05-12-2019, 07:13 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

If the captions on those options are static then you don't need code at all - it is far easier to set this by editing the form itself. If your code is making them static for the sake of showing us your code then I would still use the Form Initialize macro instead of doing it as part of the Document_New macro which locks you into only ever seeing the form in a new document.

FWIW, you could do it in your macro if you change the order to set the captions after the form loads
Code:
Private Sub Document_New()
  'Automatically runs when this document is opened.
  With formMain
    .Show
    .optSch1.Caption = "School One"
    .optSch2.Caption = "School Two"
    .optSch3.Caption = "School Three"
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote