Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 05-12-2019, 07:13 PM
Guessed's Avatar
Guessed Guessed is offline Have user form label assigned by variable? Windows 10 Have user form label assigned by variable? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Have user form label assigned by variable? Assigning a string variable to a userform label caption Larry_1 Excel Programming 3 12-18-2017 06:59 AM
MACRO in infinite loop when it encounters user defined figure label photoval Word VBA 3 02-02-2016 08:26 PM
Variable arrays from user input SeattleITguy Excel Programming 1 01-29-2015 09:19 AM
Have user form label assigned by variable? User input to a variable on the document dsm1995gst Word VBA 1 09-03-2013 03:43 PM
Task Form disappearing when assigned zoids Outlook 0 03-27-2011 05:01 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft