#1
|
|||
|
|||
setfocus crashes in word form textbox sub
Attempting to set focus on next logical textbox from code in current textbox using VBA in Word2016 running windows 10 on a Dell Laptop.
My test form has two text boxes with default names Textbox1 and Textbox2. Code:
Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) TextBox2.SetFocus End Sub Quote:
I can close the dialog and form. But when I try to close the word document I get a messagebox Quote:
Curiously, I have no problem using setfocus within my command button Click sub. When I remove the setfocus, the text1 box remains active and the user must tab. So it's not a crisis, just tacky. |
Tags |
mouse controllable, vba change textbox word, word 2016-64 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pass the selected in Combobox to a Textbox of a Word form | Visor | Word VBA | 10 | 07-24-2020 08:38 AM |
Validate textbox fields in VBA Form before Submit | ScottyBee | Word VBA | 5 | 03-20-2019 04:46 PM |
Create a ComboBox in a Form that creates a new document and autofills a textBox | BlackGirlMagic | Word VBA | 5 | 02-13-2017 02:39 PM |
how to save contents in textbox in VB2013 form into a Word document? | saltlakebuffalo | Word VBA | 6 | 12-10-2014 06:12 PM |
PowerPoint 2007 Textbox Lock / Form Issues | LTechie12 | PowerPoint | 0 | 01-08-2012 02:08 PM |