|
-
Feb 9th, 2006, 05:37 AM
#1
Thread Starter
Frenzied Member
Remove Ctrl+Tab from user input in VBA
Hi,
I have a text box in vba userform. In run time, if the user presses Ctrl + Tab it appears in text box. Normally in vb it will not accept Ctrl+Tab. but, in vba it accepts Ctrl+Tab in text box. how to avoid this in vba. i.e., If the user presses the Ctrl+Tab nothing should happen.
Thanks in advance
-
Feb 9th, 2006, 06:56 AM
#2
Re: Remove Ctrl+Tab from user input in VBA
VBA question moved to Office Development
-
Feb 9th, 2006, 12:25 PM
#3
Re: Remove Ctrl+Tab from user input in VBA
You can trap for the Tab (chr(9)) in the change event of the textbox and parse it out.
VB Code:
Private Sub TextBox1_Change()
If InStr(1, TextBox1.Text, Chr(9)) > 0 Then
TextBox1.Text = Replace(TextBox1.Text, Chr(9), "")
End If
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 9th, 2006, 12:29 PM
#4
Re: Remove Ctrl+Tab from user input in VBA
Also make sure the TabKeyBehavior property is set to False.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|