Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-10-2024, 11:13 AM
viewtost viewtost is offline Ensure that a form has been completed Windows 10 Ensure that a form has been completed Office 2019
Advanced Beginner
Ensure that a form has been completed
 
Join Date: Jul 2021
Posts: 35
viewtost is on a distinguished road
Default Ensure that a form has been completed

Hello all,

I hope you are well.

I have a form with three different lines:

Name: Itīs a rich text content control
Surname: Itīs a rich text content control
Start date: Itīs a date picker content control

I would like to write a macro that checks if all the fields of the form (name, surname, and start date) have been filled. If they have been filled in, I want a message to pop up saying “Ready to be printed”; if any of the fields have not been completed, I want a message to pop up saying “Please complete all the fields”.

Then, when people fill in the form, they can run the macro to ensure they haven't missed any fields before printing it out. The form will contain more fields in the future, so I would like a macro that could work with any new fields that I may add to the form.



For better understanding, I am attaching an example of the form

Thanks!
Attached Files
File Type: docm Example of form.docm (18.8 KB, 1 views)
Reply With Quote
  #2  
Old 02-11-2024, 10:42 AM
Charles Kenyon Charles Kenyon is offline Ensure that a form has been completed Windows 11 Ensure that a form has been completed Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Validate Content Controls Entries may give you some guidance.
Reply With Quote
  #3  
Old 02-12-2024, 02:16 AM
viewtost viewtost is offline Ensure that a form has been completed Windows 10 Ensure that a form has been completed Office 2019
Advanced Beginner
Ensure that a form has been completed
 
Join Date: Jul 2021
Posts: 35
viewtost is on a distinguished road
Default

Hi Charles,

Thank you for your reply and your help. Unfortunately, I am not great at coding, so it will take me a while to tailor the macro from the website you shared to what I need.

Would it be possible to not use content controls? i.e., just to create a macro that verifies whether the information next to the fields Name, Surname, and Start Date is blank or not?

Name:
Surname:
Start date:

Thanks again!
Reply With Quote
  #4  
Old 02-12-2024, 07:38 AM
Charles Kenyon Charles Kenyon is offline Ensure that a form has been completed Windows 11 Ensure that a form has been completed Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Content Controls are absolutely the simplest method.
Is the form being filled out in the desktop Word program?


I expect that someone else will be along to give you the code you need. Please be patient. I do not have code already written and am not the best person to be writing it for you.


"Field," in Word jargon is a term of art. Fields are an old technology.

Reply With Quote
  #5  
Old 02-12-2024, 07:42 AM
Charles Kenyon Charles Kenyon is offline Ensure that a form has been completed Windows 11 Ensure that a form has been completed Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Why are any of these Rich Text Content Controls rather than Plain Text CCs?
You cannot use the Tab key to move out of Rich Text Content Controls.
Reply With Quote
  #6  
Old 02-12-2024, 04:16 PM
viewtost viewtost is offline Ensure that a form has been completed Windows 10 Ensure that a form has been completed Office 2019
Advanced Beginner
Ensure that a form has been completed
 
Join Date: Jul 2021
Posts: 35
viewtost is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
Content Controls are absolutely the simplest method.
Is the form being filled out in the desktop Word program?


I expect that someone else will be along to give you the code you need. Please be patient. I do not have code already written and am not the best person to be writing it for you.


"Field," in Word jargon is a term of art. Fields are an old technology.

Agreed, they are the simplest method as they allow you to move quickly in the form by just pressing the tab key, and you can select different types of them like dropdown menus, date picker...

The form is filled out in the desktop app.

Apologies if I am not being using the right word as English is not my first language. I believe, that the right word to use should be placeholder.
Reply With Quote
  #7  
Old 02-12-2024, 04:17 PM
viewtost viewtost is offline Ensure that a form has been completed Windows 10 Ensure that a form has been completed Office 2019
Advanced Beginner
Ensure that a form has been completed
 
Join Date: Jul 2021
Posts: 35
viewtost is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
Hi,

I thought you could use the tab key to move out of them. Then, a plain one should work as I donīt need a specific format for the content.
Reply With Quote
  #8  
Old 02-12-2024, 07:46 PM
Charles Kenyon Charles Kenyon is offline Ensure that a form has been completed Windows 11 Ensure that a form has been completed Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

The Rich Text control is for when you want to have multiple formats or other Content Controls within. You can do that and set the control so that it can't be deleted.

You can require a certain style in a Plain Text Control. What I usually do is just insert the control and then apply what formatting I want to the entire control if I did want some special formatting. In my experience, such formatting works fine. I would use the CC property of a certain style only if I wanted it to keep that style no matter what the user wanted to do.
Reply With Quote
  #9  
Old 02-13-2024, 03:25 AM
viewtost viewtost is offline Ensure that a form has been completed Windows 10 Ensure that a form has been completed Office 2019
Advanced Beginner
Ensure that a form has been completed
 
Join Date: Jul 2021
Posts: 35
viewtost is on a distinguished road
Default

Once again, thanks for your help.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Control Boxes Print on Completed Form Lambchop6 Word 2 04-05-2017 05:16 PM
Ensure that a form has been completed Disable email function of command button if all form fields are not completed derajlance Word VBA 10 05-11-2016 01:05 PM
Ensure that a form has been completed ensure I have an 8.5x11 sheet Taylor Word 3 10-09-2011 12:39 AM
Ensure that a form has been completed How to ensure that each line ends only at the margin sparemejava Word 9 02-06-2011 03:21 PM
Convert a completed form to verbalized text tsttm Word 0 07-09-2010 05:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:12 AM.


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