Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-18-2019, 06:30 PM
ScottyBee ScottyBee is offline Validate textbox fields in VBA Form before Submit Windows 10 Validate textbox fields in VBA Form before Submit Office 2016
Novice
Validate textbox fields in VBA Form before Submit
 
Join Date: Mar 2019
Location: Portland, Oregon
Posts: 12
ScottyBee is on a distinguished road
Default Validate textbox fields in VBA Form before Submit

I have a user form I created in VBA that has 8 textboxes for the user to complete. The controls are named txt1, txt2......txt8.



I want to have VBA verify that all fields have been filled in before the code returns the results to the document.

I have a command button in the form that takes the value of each textbox field and inserts it at the designated bookmark in in the document. I successfully added code to the button click event that will display a message box when the user leaves a field empty.

My problem is that I cannot figure out how to break execution of the code which will automatically return focus to the empty field and STAY there. I do have code in the click event to return focus to the empty field but the code continues to run and inserts a null value in the document.

Any ideas are greatly appreciated. BTW, I have done multiple searches on the internet and in here but could not find an answer.

I am using Word 2016 in Windows 10. Thanks
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook Custom form - submit and approve buttons R Mohan Outlook 0 06-18-2018 12:57 PM
Infopath PDF attached to Form not showing in Email Submit CliffEstel Misc 0 09-20-2016 11:04 AM
Submit form deb Word 0 06-20-2015 07:01 AM
Macro to keep formatted form fields after mail merge or replace text with formatted form fields jer85 Word VBA 2 04-05-2015 10:00 PM
Validate textbox fields in VBA Form before Submit VBA Code for a SUBMIT button in a Word form BlueMax Word VBA 3 08-07-2013 06:26 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft