Dragon71
03-19-2009, 10:00 PM
Guys
Got my userform to work the other day with help from Lucas (thanks again)
Trouble is i have created another userform identical to the first with just the arrays changed and i keep getting an error message
Runtime error 5012 You entered multiple destinations for a page,line,footnote ,endnote or comment
Please help
Code is below
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Initialize()
ListBox1.List = Array("Natural", "FRAS", "Ceramic", "Polyuethane")
ListBox1.ListIndex = 0
ListBox3.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20")
ListBox3.ListIndex = 0
ListBox4.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20")
ListBox4.ListIndex = 0
ListBox5.List = Array("Yes", "No")
ListBox5.ListIndex = 0
ListBox6.List = Array("N/A", "Damaged", "Replace", "Re Use", "Requires Repair")
ListBox6.ListIndex = 0
ListBox7.List = Array("Yes", "No")
ListBox7.ListIndex = 0
ListBox8.List = Array("N/A", "Completely Worn", "Outer Edge Worn", "Centre Worn")
ListBox8.ListIndex = 0
End Sub
Private Sub cmdOK_Click()
Call FillABookmark("Laggingtype", "Listbox1.Value")
Call FillABookmark("LaggingDia", TextBox1.Value)
Call FillABookmark("Laggingthicknessmax", ListBox3.Value)
Call FillABookmark("Laggingthicknessmin", ListBox4.Value)
Call FillABookmark("Laggingdamage", ListBox5.Value)
Call FillABookmark("Laggingdamagedetails", ListBox6.Value)
Call FillABookmark("Laggingwear", ListBox7.Value)
Call FillABookmark("Lagginweardetails", ListBox8.Value)
Call FillABookmark("LaggingTir", TextBox2.Value)
Call FillABookmark("Laggingpattern", TextBox4.Value)
End Sub
Private Sub cmdClearForm_Click()
Call FillABookmark("Laggingtype", "")
Call FillABookmark("LaggingDia", "")
Call FillABookmark("Laggingthicknessmax", "")
Call FillABookmark("Laggingthicknessmin", "")
Call FillABookmark("Laggingdamage", "")
Call FillABookmark("Laggingdamagedetails", "")
Call FillABookmark("Laggingwear", "")
Call FillABookmark("Laggingweardetails", "")
Call FillABookmark("LaggingTir", "")
Call FillABookmark("Laggingpattern", "")
End Sub
Private Sub cmdEnd_Click()
End
End Sub
Private Sub CommandButton1_Click()
Shell ("osk")
End Sub
Module i am using for both forms is
Sub FillABookmark(strBM_Name As String, strBM_Text As String)
With Selection
.GoTo what:=wdGoToBookmark, Name:=strBM_Name
.Collapse Direction:=wdCollapseEnd
ActiveDocument.Bookmarks(strBM_Name).Range.Text = strBM_Text
.MoveEnd unit:=wdCharacter, Count:=Len(strBM_Text)
ActiveDocument.Bookmarks.Add Name:=strBM_Name, Range:=Selection.Range
.Collapse Direction:=wdCollapseEnd
End With
End Sub
Form one is identical as said,just changes to the arrays
When you go to run it it gets that error
Thanks
Got my userform to work the other day with help from Lucas (thanks again)
Trouble is i have created another userform identical to the first with just the arrays changed and i keep getting an error message
Runtime error 5012 You entered multiple destinations for a page,line,footnote ,endnote or comment
Please help
Code is below
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Initialize()
ListBox1.List = Array("Natural", "FRAS", "Ceramic", "Polyuethane")
ListBox1.ListIndex = 0
ListBox3.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20")
ListBox3.ListIndex = 0
ListBox4.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20")
ListBox4.ListIndex = 0
ListBox5.List = Array("Yes", "No")
ListBox5.ListIndex = 0
ListBox6.List = Array("N/A", "Damaged", "Replace", "Re Use", "Requires Repair")
ListBox6.ListIndex = 0
ListBox7.List = Array("Yes", "No")
ListBox7.ListIndex = 0
ListBox8.List = Array("N/A", "Completely Worn", "Outer Edge Worn", "Centre Worn")
ListBox8.ListIndex = 0
End Sub
Private Sub cmdOK_Click()
Call FillABookmark("Laggingtype", "Listbox1.Value")
Call FillABookmark("LaggingDia", TextBox1.Value)
Call FillABookmark("Laggingthicknessmax", ListBox3.Value)
Call FillABookmark("Laggingthicknessmin", ListBox4.Value)
Call FillABookmark("Laggingdamage", ListBox5.Value)
Call FillABookmark("Laggingdamagedetails", ListBox6.Value)
Call FillABookmark("Laggingwear", ListBox7.Value)
Call FillABookmark("Lagginweardetails", ListBox8.Value)
Call FillABookmark("LaggingTir", TextBox2.Value)
Call FillABookmark("Laggingpattern", TextBox4.Value)
End Sub
Private Sub cmdClearForm_Click()
Call FillABookmark("Laggingtype", "")
Call FillABookmark("LaggingDia", "")
Call FillABookmark("Laggingthicknessmax", "")
Call FillABookmark("Laggingthicknessmin", "")
Call FillABookmark("Laggingdamage", "")
Call FillABookmark("Laggingdamagedetails", "")
Call FillABookmark("Laggingwear", "")
Call FillABookmark("Laggingweardetails", "")
Call FillABookmark("LaggingTir", "")
Call FillABookmark("Laggingpattern", "")
End Sub
Private Sub cmdEnd_Click()
End
End Sub
Private Sub CommandButton1_Click()
Shell ("osk")
End Sub
Module i am using for both forms is
Sub FillABookmark(strBM_Name As String, strBM_Text As String)
With Selection
.GoTo what:=wdGoToBookmark, Name:=strBM_Name
.Collapse Direction:=wdCollapseEnd
ActiveDocument.Bookmarks(strBM_Name).Range.Text = strBM_Text
.MoveEnd unit:=wdCharacter, Count:=Len(strBM_Text)
ActiveDocument.Bookmarks.Add Name:=strBM_Name, Range:=Selection.Range
.Collapse Direction:=wdCollapseEnd
End With
End Sub
Form one is identical as said,just changes to the arrays
When you go to run it it gets that error
Thanks