"Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus."
Whenever I try to run my form this error ms occurs.
I know it has something to do with my txtcomapny and txtItemName, but where do I move these functions so I can prevent this msg.
txtcompany.setfocus and txtItemName.setfocus
My code is here
Private Sub cmdOK_Click()
With ActiveDocument.Paragraphs(1).Range
.InsertAfter txtCompany
.InsertParagraphAfter
.InsertParagraphAfter
.InsertAfter txtClient
.InsertParagraphAfter
.InsertParagraphAfter
.Font.Name = "Times New Romans"
.Font.Size = 12
.Font.Bold = True
End With
fraProduct.Visible = False
fraClient.Visible = True
txtItemName.SetFocus
End Sub
Private Sub CmdQuit_Click()
Unload Me
End Sub
Private Sub cmdQuit2_Click()
Unload Me
End Sub
Private Sub cmOK2_Click()
With ActiveDocument.Paragraphs(1).Range
.InsertAfter txtItemName
.InsertParagraphAfter
.InsertParagraphAfter
.InsertAfter txtQuantity
.InsertParagraphAfter
.InsertParagraphAfter
.Font.Name = "Times New Romans"
.Font.Size = 12
.Font.Bold = True
End With
End Sub
Private Sub CommandButton3_Click()
Unload Me
End Sub
Private Sub Userform_Initialize()
fraClient.Visible = False
fraProduct.Visible = True
With ActiveDocument.Paragraphs.TabStops
.ClearAll
.Add Position:=InchesToPoints(5), _
Alignment:=wdAlignTabRight, _
Leader:=wdTabLeaderSpaces
End With
txtCompany.SetFocus
End Sub
Thanks for the help