Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Userform showing text after being displayed (2000)

    Hi,

    I have created a Userform where I have a button (actually several), I display the form, then when I press the button I want some text to appear in a text box, basically it is some simple online help for the User. I have set up the form and buttons, when I test it I just get the word FALSE appearing in the text box, I guess I am missing some redisplay command.

    Any clues.................

    Regards

    Mike

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform showing text after being displayed (2000)

    Could you show us the code behind the button that gets pressed?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform showing text after being displayed (2000)

    Hi Jan

    Here is all the code in the Userform, the area specifically for the button is Help2_Click.


    Regards

    Mike

    Private Sub OptionButton11_Click()

    End Sub

    Private Sub OptionButton8_Click()

    End Sub

    Private Sub AddPortetc_Click()

    If maincontrol.AddPortetc = "True" Then
    blnAddPortetc = True
    Else
    blnAddPortetc = False
    End If

    End Sub

    Private Sub AddProjects_Click()

    If maincontrol.AddProjects = "True" Then
    blnAddProj = True
    Else
    blnAddProj = False
    End If

    End Sub

    Private Sub BehindT_Click()

    If maincontrol.BehindT = "True" Then
    blnBehindT = True
    Else
    blnBehindT = False
    End If

    End Sub

    Private Sub CancelB_Click()

    blnCancelb = True
    blnDone = True
    Unload Me

    End Sub

    Private Sub ChangedM_Click()

    If maincontrol.ChangedM = "True" Then
    blnChangedM = True
    Else
    blnChangedM = False
    End If

    End Sub

    Private Sub ComboBox1_Change()

    End Sub

    Private Sub CheckBox5_Click()

    End Sub

    Private Sub CommandButton1_Click()

    If maincontrol.SpecialExit = True Then
    blnSpecialExit = True
    Else
    blnSpecialExit = False
    End If

    End Sub

    Private Sub Frame2_Click()

    End Sub

    Private Sub FromDate_Change()

    strFromDate = maincontrol.FromDate

    If strFromDate = "" Then
    strFromDate = "000101"
    End If

    End Sub

    Private Sub FullReport_Click()

    If maincontrol.FullReport = "True" Then
    blnFullReport = True
    Else
    blnFullReport = False
    End If

    End Sub

    Private Sub GreenLevel_Change()

    intGreen = maincontrol.GreenLevel

    End Sub

    Private Sub Help1_Click()

    strHelpText1 = ""

    End Sub

    Private Sub Help2_Click()

    maincontrol.HelpText = "This is the Utilities section and is used for" + Chr$(10) = _
    "Tidying the Log files" + Chr$(10) + _
    "Adding Projects" + Chr$(10) + _
    "Adding Portfolio's, Programs, Project Managers etc" + Chr$(10) + Chr$(10) + _
    "The end"

    End Sub

    Private Sub Help3_Click()

    End Sub

    Private Sub MissedM_Click()

    If maincontrol.MissedM = "True" Then
    blnMissedM = True
    Else
    blnMissedM = False
    End If

    End Sub

    Private Sub NewProject_Click()

    If maincontrol.NewProject = "True" Then
    blnNewProject = True
    Else
    blnNewProject = False
    End If

    blnNewProject = True

    End Sub

    Private Sub OptionButton1_Click()

    End Sub

    Private Sub Other_Click()

    blnOther = True

    End Sub

    Private Sub PortfolioReport_Click()

    If maincontrol.PortfolioReport = "True" Then
    blnPortfolioReport = True
    Else
    blnPortfolioReport = False
    End If

    End Sub

    Private Sub ProcessB_Click()

    blnProcessB = True
    strProjectMgr = maincontrol.ProjectMgr
    strPortfolioName = maincontrol.PortfolioName
    strProgramName = maincontrol.ProgramName
    strProjectName = maincontrol.ProjectName

    strProjectID = maincontrol.ProjectID

    strHelpText1 = maincontrol.ProjectReport
    strHelpText2 = maincontrol.ProjectReport

    strParmPortfolio = maincontrol.PortfolioName
    strParmProgram = maincontrol.ProgramName
    strParmProject = maincontrol.ProjectName
    strParmFromDate = maincontrol.FromDate
    strParmToDate = maincontrol.ToDate
    strParmMissedM = maincontrol.MissedM
    strParmChangedM = maincontrol.ChangedM
    strParmBehindT = maincontrol.BehindT
    strParmOther = maincontrol.Other
    strParmRepAll = maincontrol.FullReport
    strParmRepPortfolio = maincontrol.PortfolioReport
    strParmRepProgram = maincontrol.ProgramReport
    strParmRepProject = maincontrol.ProjectReport
    strParmRed = maincontrol.RedLevel
    strParmGreen = maincontrol.GreenLevel


    Unload Me

    End Sub

    Private Sub ProgramReport_Click()

    If maincontrol.ProgramReport = "True" Then
    blnProgramReport = True
    Else
    blnProgramReport = False
    End If

    End Sub

    Private Sub ProjectReport_Click()

    If maincontrol.ProjectReport = "True" Then
    blnProjectReport = True
    Else
    blnProjectReport = False
    End If

    End Sub

    Private Sub TextBox2_Change()

    End Sub

    Private Sub RedLevel_Change()

    intRed = maincontrol.RedLevel

    End Sub

    Private Sub SpecialExit_Click()

    blnSpecialExit = True

    End Sub

    Private Sub TextBox1_Change()

    End Sub

    Private Sub ToDate_Change()

    strToDate = maincontrol.ToDate

    If strToDate = "" Then
    strToDate = "991231"
    End If

    End Sub

    Private Sub Userform_Initialize()

    With maincontrol.PortfolioName

    For intCount1 = 1 To 50

    If aryPortfolioName(intCount1) = "" Then
    Exit For
    End If

    .AddItem aryPortfolioName(intCount1)

    Next intCount1

    End With

    With maincontrol.ProgramName

    For intCount1 = 1 To 50

    If aryProgramName(intCount1) = "" Then
    Exit For
    End If

    .AddItem aryProgramName(intCount1)

    Next intCount1

    End With

    With maincontrol.ProjectMgr

    For intCount1 = 1 To 50

    If aryProjectManager(intCount1) = "" Then
    Exit For
    End If

    .AddItem aryProjectManager(intCount1)

    Next intCount1

    End With

    With maincontrol.ProjectName

    For intCount1 = 1 To 1000

    If aryProjectName(intCount1) = "" Then
    Exit For
    End If

    .AddItem aryProjectName(intCount1)

    Next intCount1

    End With

    maincontrol.RedLevel = 40
    maincontrol.GreenLevel = 75
    maincontrol.ReportNum = intReportNumber

    End Sub

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform showing text after being displayed (2000)

    There is a typo in there. replace the equal sign just before the first line break with a plus:

    maincontrol.HelpText = "This is the Utilities section and is used for" + Chr$(10) <span style="background-color: #FFFF00; color: #000000; font-weight: bold">+</span hi> _
    "Tidying the Log files" + Chr$(10) + _
    "Adding Projects" + Chr$(10) + _
    "Adding Portfolio's, Programs, Project Managers etc" + Chr$(10) + Chr$(10) + _
    "The end"
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform showing text after being displayed (2000)

    Hi Jan,

    Many thanks, I feel a bit stupid!!!!. I am using CHR$(10) to create a new line but in my field I get a symbol and no new line, any ideas why.

    Regards

    Mike

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Userform showing text after being displayed (2000)

    Have you set the MultiLine property of the text box to True?

    Note: VBA has constants vbLf = Chr(10), vbCr = Chr(13) and vbCrLf = Chr(13) & Chr(10). They make code easier to type and read.

  7. #7
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform showing text after being displayed (2000)

    Thanks Jan, all ok now.................................... Regards Mike

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform showing text after being displayed (2000)

    And vbNewline...
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Userform showing text after being displayed (2000)

    There are more - look up one of them in the Object Browser and you'll see the whole list. Under Windows, vbNewLine is the same as vbCrLf; I believe it is the same as vbCr under MacOS, but I'm not sure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •