I have two separate user forms of which the only difference is the place in which they put the data. The Userform "TaskForm" works fine but when i copied across the code to Userform "AssessmentForm" and changed the relevant details it says "File Not Found" Followed by "Run-time error 361"
The following code is what i was using
The following code is what i was using
VBA Code:
Private Sub Cancel1_Click()
Unload Me
End Sub
Private Sub Clear1_Click()
Subject1.Clear
Level1.Clear
TypeOfTask1.Clear
Description1.Value = ""
DueDate1.Value = ""
Call AssessmentForm_Initialize
End Sub
Private Sub Entry1_Click()
Sheet1.Activate
Cells(18, 8).Value = Subject1.Value
Cells(18, 9).Value = Level1.Value
Cells(18, 10).Value = TypeOfTask1.Value
Cells(18, 11).Value = Description1.Value
Cells(18, 12).Value = DueDate1.Value
ActiveWorkbook.Worksheets("Lists").ListObjects("Table1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Lists").ListObjects("Table1").Sort.SortFields.Add2 _
Key:=Range("Table1[[#All],[Due Date]]"), SortOn:=xlSortOnValues, Order:= _
xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Lists").ListObjects("Table1").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Private Sub AssessmentForm_Initialize()
Subject1.AddItem "Mathematics"
Subject1.AddItem "English"
Subject1.AddItem "Science"
Subject1.AddItem "Geography"
Subject1.AddItem "Commerce"
Subject1.AddItem "Essential Skills"
Subject1.AddItem "History"
Subject1.AddItem "Graphics"
Subject1.AddItem "PDH"
Subject1.AddItem "PE"
Subject1.AddItem "Other"
Level1.AddItem "Assessment"
Level1.AddItem "Formative"
Level1.AddItem "Class"
Level1.AddItem "Other"
Level1.AddItem "Draft"
Level1.AddItem "Plan (Assessment)"
Level1.AddItem "Checkpoint"
Level1.AddItem "Plan (Checkpoint)"
TypeOfTask1.AddItem "Essay"
TypeOfTask1.AddItem "Worksheet"
TypeOfTask1.AddItem "Exercise"
TypeOfTask1.AddItem "Exam"
TypeOfTask1.AddItem "Quiz"
TypeOfTask1.AddItem "Mindmap"
TypeOfTask1.AddItem "Notes"
TypeOfTask1.AddItem "Video"
TypeOfTask1.AddItem "Read"
TypeOfTask1.AddItem "Report"
TypeOfTask1.AddItem "Other"
TypeOfTask1.AddItem "Checkpoint"
TypeOfTask1.AddItem "Speech"
TypeOfTask1.AddItem "Summary"
TypeOfTask1.AddItem "CAD"
End Sub