badkatro
2/23/2016 - 11:18 AM

New, missing deadline time produces error

New, missing deadline time produces error

Sub Initialize_PreFilled_Sections()

If Me.astInitData <> "" Then
    'Call Activate_Section(EnabledState:=True, SectionName:="ast", ColorCode:=Me.PrepAccentColor)
    'If Me.traCbo.Enabled Then Me.traCbo.SetFocus
    Me.astCbo = Split(astInitData, ",")(0)
    Me.astCbo.ForeColor = wdColorGray50
    
    Me.astDeadlineDay = Format(Split(Split(astInitData, ",")(1), " - ")(0), Me.cbDateformat)
    Me.astDeadlineTime = Split(Split(astInitData, ",")(1), " - ")(1)
End If

If Me.traInitData <> "" Then
    
    If InStr(1, traInitData, ",") > 0 Then
    
        'Call Activate_Section(EnabledState:=True, SectionName:="tra", ColorCode:=Me.TraAccentColor)
        'If Me.traCbo.Enabled Then Me.traCbo.SetFocus
        Me.traCbo = Split(traInitData, ",")(0)
        Me.traCbo.ForeColor = wdColorGray50
    
        Me.traDeadlineDay = Format(Split(Split(traInitData, ",")(1), " - ")(0), Me.cbDateformat)
        
        If InStr(1, Split(traInitData, ",")(1), "-") Then
            Me.traDeadlineTime = Split(Split(traInitData, ",")(1), " - ")(1)
        End If
        
        
    Else
        
    End If
    
End If


End Sub