Unexpected Termination of Sub from class property

PanzerRanger

New Member
Joined
Jan 3, 2018
Messages
20
I have a form that gets data from a class but somehow when the nested sub that reads the data to the form gets terminated premature
Code:
Private BA As BidApproval

Private Sub UserForm_Initialize() 
    Set BA = New BidApproval
    For Each c In Me.Controls
        If TypeName(c) = "ComboBox" Then
            c.AddItem "JA"
            c.AddItem "NEJ"
            c.Value = "NEJ"
        End If
    Next c
    On Error Resume Next
    Call ReadData    ' Code that asigns data to the form
    Call ReadSignature
    Call LockDown
End Sub

Private Sub ReadData()
    Me.TextBox_Customer = BA.Customer
    Me.TextBox_Description = BA.Description
    Me.TextBox_Notes = BA.Notes
    If Not BA.Bid = "" Then Me.ComboBox_Bid = BA.Bid
    If Not BA.Calculation = "" Then Me.ComboBox_Calculation = BA.Calculation
    If Not BA.Materialspecification = "" Then Me.ComboBox_Materials = BA.Materialspecification
    If Not BA.Specification = "" Then Me.ComboBox_Specification = BA.Specification
    If Not BA.Timeplan = "" Then Me.ComboBox_Timeplan = BA.Timeplan
    If Not BA.ContractorAvailible = "" Then Me.ComboBox_Contractor = BA.ContractorAvailible
    If Not BA.PreDesign = "" Then Me.ComboBox_Predesigned = BA.PreDesign
    If Not BA.TechnicanTime = "" Then Me.TextBox_TimeTechnican.Value = BA.TechnicanTime   ' This property terminats the sub
    If Not BA.ClerkTime = "" Then Me.TextBox_TimeClerk = BA.ClerkTime
    If Not BA.BidSum = "" Then Me.TextBox_BidTotal = BA.BidSum
    If Not BA.ContractorSum = "" Then Me.TextBox_ContractorTotal = BA.ContractorSum
End Sub

Public Property Let TechnicanTime(Val As Long) ' Class Property
    With Form
        .Range("A22") = Val
    End With
End Property


Public Property Get TechnicanTime() As Long ' Class Property
    With Form
        TechnicanTime = .Range("A22")
    End With
End Property   ' When I step out from here it terminates the sub Readdata despite more values are suppose to be read. The format of the A22 is number
 
Last edited by a moderator:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Care to share the answer in case it helps someone else?
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top