Izandol sorry for being so ignorant with this but when I put the code into my initialize script it stops at those two lines? I posted the code below, sorry I'm a complete noob at this (This is my first use of VBA coding)
Private Sub UserForm_Initialize()
Set m_clsAnchors = New CAnchors
Set m_clsAnchors.Parent = Me
' restrict minimum size of userform
m_clsAnchors.MinimumWidth = 45
m_clsAnchors.MinimumHeight = 250
With m_clsAnchors
.Anchor("Textbox1").AnchorStyle = enumAnchorStyleLeft Or enumAnchorStyleRight
.Anchor("cmdBrowse").AnchorStyle = enumAnchorStyleTop Or enumAnchorStyleRight
.Anchor("labDiv1").AnchorStyle = enumAnchorStyleLeft Or enumAnchorStyleRight
With .Anchor("frame1")
.AnchorStyle = enumAnchorStyleLeft Or enumAnchorStyleRight Or _
enumAnchorStyleBottom Or enumAnchorStyleTop
.MinimumHeight = 120
End With
.Anchor("listbox1").AnchorStyle = enumAnchorStyleLeft Or _
enumAnchorStyleRight Or _
enumAnchorStyleBottom Or _
enumAnchorStyleTop
With .Anchor("cmdClear")
.AnchorStyle = enumAnchorStyleBottom Or enumAnchorStyleRight
.MinimumTop = 90
End With
.Anchor("labDiv2").AnchorStyle = enumAnchorStyleLeft Or _
enumAnchorStyleRight Or _
enumAnchorStyleBottom
.Anchor("cmdAbout").AnchorStyle = enumAnchorStyleLeft Or enumAnchorStyleBottom
.Anchor("checkbox1").AnchorStyle = enumAnchorStyleBottom
.Anchor("cmdOk").AnchorStyle = enumAnchorStyleBottom Or enumAnchorStyleRight
End With
' live updates whilst resizing
CheckBox1.Value = True
ListBox1.RowSource = "B12:B19"
'Empty Country
Country.Value = ""
'Fill CountryBox
With Country
.AddItem "Canada"
.AddItem "USA"
End With
'Empty LogNumberBox1
LogNumberBox1.Value = ""
'Empty DivisionListBox
DivisionListBox.Clear
'Fill DivisionListBox
With DivisionListBox
.AddItem "Cavendish"
.AddItem "Construction & Equipment"
.AddItem "Industrial Security"
.AddItem "Irving Business Services"
.AddItem "IT Division"
.AddItem "Irving Consumer Products"
.AddItem "Irving Group of Companies (IGM)"
.AddItem "Irving Personal Care"
.AddItem "Media"
.AddItem "Midland"
.AddItem "Pulp & Paper"
.AddItem "Retail"
.AddItem "Sawmills"
.AddItem "Shipbuilding"
.AddItem "Transportation and Logistics"
.AddItem "Universal Properties"
.AddItem "Woodlands Division"
.AddItem "Corporate Services"
.AddItem "Other"
End With
'Empty BusinessUnitListBox
BusinessUnitListBox.Value = ""
'Fill BusinessUnitListBox
With BusinessUnitListBox
.AddItem "Cavendish Agri"
.AddItem "Cavendish Farms Lethbridge"
.AddItem "Cavendish Farms"
.AddItem "Cavendish Produce"
.AddItem "Island Gas CNG"
.AddItem "Island Holdings Limited"
.AddItem "Atlantic Wallboard"
.AddItem "Fleetway Facility Services"
.AddItem "Irving Equipment Group"
.AddItem "Kent Homes"
.AddItem "Gulf Operators"
.AddItem "Industrial Security"
.AddItem "Irving Business Services"
.AddItem "IT Division"
.AddItem "Irving Consumer Products"
.AddItem "Irving Tissue"
.AddItem "Irving Group Corporate"
.AddItem "Irving Personal Care"
.AddItem "Brunswick News"
.AddItem "Midland"
.AddItem "Irving Forest Services"
.AddItem "Irving Paper"
.AddItem "Irving Pulp & Paper"
.AddItem "Irving Tissue, Saint John"
.AddItem "JDI Financial Services"
.AddItem "Lake Utopia"
.AddItem "Chandler"
.AddItem "Kent Building Supplies"
.AddItem "Plasticraft"
.AddItem "Sawmills"
.AddItem "Fleetway Engineering"
.AddItem "Irving Shipbuilding"
.AddItem "Halifax Shipyard"
.AddItem "Atlantic Towing"
.AddItem "Harbour Development"
.AddItem "Irving Transportation Services"
.AddItem "ITS Carriers Inc."
.AddItem "JDI Logistics"
.AddItem "Kent Line"
.AddItem "New Brunswick Southern Railway"
.AddItem "RST Industries"
.AddItem "Sunbury Transport Limited"
.AddItem "Universal Truck & Trailer"
.AddItem "Universal Properties"
.AddItem "Woodlands"
.AddItem "Bayside Realties"
.AddItem "Evergreen Gardens"
.AddItem "Irving Air Service"
.AddItem "St.George Power"
.AddItem "JDI General Division"
.AddItem "Irving Shipbuilding-Local 1"
.AddItem "Irving Shipbuilding-Local 28"
.AddItem "Shelburne"
.AddItem "Irving Shipbuilding - Staff"
.AddItem "Irving Paper-Local 601"
.AddItem "Irving Paper-Loca l523"
.AddItem "Irving Paper-Local 30"
.AddItem "Irving Paper-Local 1888"
End With
'Uncheck ChangeBoxes
HireBox.Value = False
RehireBox.Value = False
TransferBox.Value = False
PersonalChangeBox.Value = False
'Clear EmployeeInformationBox
TextBox2.Value = ""
TextBox3.Value = ""
'Uncheck TypeBoxes
PlanBox1.Value = False
PlanBox2.Value = False
PlanBox3.Value = False
'Clear DateBoxes
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
'Clear CommentsBox
CommentsBox.Value = ""
'Uncheck EmploymentBox
HourlyBox.Value = False
SalaryBox.Value = False
'Uncheck SpecialistBox
SpecialistCheckBox1 = False
SpecialistCheckBox2 = False
SpecialistCheckBox3 = False
SpecialistCheckBox4 = False
SpecialistCheckBox5 = False
End Sub
Bookmarks