Keeping a table in a form editable and checking that fields are filled in before allowing a save

Firstly apologies if this is the incorrect forum but I was looking for
a general word forum and could not find one. Please point me to one if
one exists.

I am trying to create a form where I want to specify what items need
to be filled in. (Review minutes from design reviews). I want to make
certain fields mandatory like the date, attendees and check list used
and want to block saving of the document with a warning until they are
filled in. Is there a way of doing this?

Also as a part of the review actions are filled in to a table.
depending on how many actions there are the table may be large or
small so I really want to allow edits to the table so that rows can be
added or deleted and text can just be written to it. However when I
protect the form the table becomes locked unless I add fields to each
cell of the table. Is thee a way of stopping the table itself from
being locked when the document is protected?

Many thanks in advance.

Gary
0
Gazza
6/2/2010 8:19:20 AM
word.vba.general 1023 articles. 1 followers. Follow

2 Replies
1330 Views

Similar Articles

[PageSpeed] 32

Running a macro containing the following code on exit from the last 
formfield in the table will add a row to the table containing formfields in 
each cell:

Dim rownum As Integer, i As Integer
With ActiveDocument
    .Unprotect
    .Tables(1).Rows.Add
    rownum = .Tables(1).Rows.Count
    For i = 1 To 3
        .FormFields.Add Range:=.Tables(1).Cell(rownum, i).Range,
Type:=wdFieldFormTextInput
    Next i
    .FormFields.Add Range:=.Tables(1).Cell(rownum, 4).Range,
Type:=wdFieldFormDropDown
    With .Tables(1).Cell(rownum, 4).Range.FormFields(1).DropDown.ListEntries
        .Add "Item1"
        .Add "Item2"
        .Add "Item3"
        .Add "Item4"
        .Add "Item5"
    End With
    .FormFields.Add Range:=.Tables(1).Cell(rownum, 5).Range,
Type:=wdFieldFormDropDown
    With .Tables(1).Cell(rownum, 5).Range.FormFields(1).DropDown.ListEntries
        .Add "ItemA"
        .Add "ItemB"
        .Add "ItemC"
        .Add "ItemD"
        .Add "ItemE"
    End With
    .Tables(1).Cell(rownum, 5).Range.FormFields(1).ExitMacro = "addrow"
    .Tables(1).Cell(rownum, 1).Range.FormFields(1).Select
    .Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End With

The macro as set up is for a five column table and it inserts Text 
FormFields into the first three cells of the new row and DropDown FormField 
in each of the fourth and fifth columns.  Modify the code for your 
circumstances.

For dealing with the requirement that the formfields be completed, see the 
article "How to validate the contents of a formfield in a Word form" at:

http://www.word.mvps.org/FAQs/TblsFldsFms/ValidateFFields.htm


-- 
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Gazza" <gary_windsor@hotmail.com> wrote in message 
news:bd4b0143-76c2-4f41-9b49-a132d537e82c@q33g2000vbt.googlegroups.com...
> Firstly apologies if this is the incorrect forum but I was looking for
> a general word forum and could not find one. Please point me to one if
> one exists.
>
> I am trying to create a form where I want to specify what items need
> to be filled in. (Review minutes from design reviews). I want to make
> certain fields mandatory like the date, attendees and check list used
> and want to block saving of the document with a warning until they are
> filled in. Is there a way of doing this?
>
> Also as a part of the review actions are filled in to a table.
> depending on how many actions there are the table may be large or
> small so I really want to allow edits to the table so that rows can be
> added or deleted and text can just be written to it. However when I
> protect the form the table becomes locked unless I add fields to each
> cell of the table. Is thee a way of stopping the table itself from
> being locked when the document is protected?
>
> Many thanks in advance.
>
> Gary 

0
Doug
6/2/2010 9:00:35 AM
If the document is to allow free editing then a protected form is not the 
answer. Use instead a userform to gather and validate the data and build the 
table - For the basics, see Word MVP FAQ - Userforms
http://word.mvps.org/FAQs/Userforms.htm

for a more in depth explanation, see
http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm

However it is certainly possible to validate form fields - 
http://www.gmayor.com/formfieldmacros.htm and it is also possible to add 
rows to a protected table (I would suggest not removing rows from a table as 
that adds unnecessarily to the complexity) and there are examples of code to 
do that at http://www.gmayor.com/word_vba_examples.htm


-- 
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



"Gazza" <gary_windsor@hotmail.com> wrote in message 
news:bd4b0143-76c2-4f41-9b49-a132d537e82c@q33g2000vbt.googlegroups.com...
> Firstly apologies if this is the incorrect forum but I was looking for
> a general word forum and could not find one. Please point me to one if
> one exists.
>
> I am trying to create a form where I want to specify what items need
> to be filled in. (Review minutes from design reviews). I want to make
> certain fields mandatory like the date, attendees and check list used
> and want to block saving of the document with a warning until they are
> filled in. Is there a way of doing this?
>
> Also as a part of the review actions are filled in to a table.
> depending on how many actions there are the table may be large or
> small so I really want to allow edits to the table so that rows can be
> added or deleted and text can just be written to it. However when I
> protect the form the table becomes locked unless I add fields to each
> cell of the table. Is thee a way of stopping the table itself from
> being locked when the document is protected?
>
> Many thanks in advance.
>
> Gary 


0
Graham
6/2/2010 9:00:51 AM
Reply:

Similar Artilces:

Problems migrating BCM data into CRM SB edition
Hi There I am having a problem migrating data from Business Contacts Manager (BCM) into CRM 3.0 Small Business edition. I have downloaded the BCM data migration pack and have followed the data migration documentation to the letter. I even cleaned up the BCM database prior to copying the files, checking them for errors using the Manage Database option in the Business Tools menu. It gets so far through the migration process and then bombs out. Here is the final few entries from the log file: 28/10/2006 12:18:53------>Transitioning to next screen. From: ConfigurationSummary screen. To: ...

incorrect check / cheque number printing
When generating a cheque run, let’s say cheque 61, 62, 63 and 64, the information printed on cheque # 62 is actually cheque # 64 and vice versa. This does not happen every cheque run, but it does happen fairly often. I have not seen GP do this. What version and service pack of GP are you using? Are you 100% sure the check stock itself is not out of sequence? Do you have any customizations? -- Victoria Yudin Dynamics GP MVP Flexible Solutions, Inc. "Syed" <Syed@discussions.microsoft.com> wrote in message news:3B02ECEF-7436-4CF3-930E-AA4D2DFDF117@microsoft.com... ...

VBA to check for latest version of front end?
I have a split database where the users have a local copy of the frontend. I would like to use VBA to check whether the users have the mostrecent version. I have set up the following tables:tVersion-Back-End (link to table in the BackEnd version)tVersion-FrontEnd (local table in the FrontEnd version)Each has a field Version where I am planning to put in the versionnumbers.Now, I am just starting to use VBA in my Access projects. Can someonepoint me to some coding to accomplish my task above? Can someone alsopoint me to a good resource (book, website, course) that would take mefrom a beginn...

PA Misc. Log Tables
Hi, How can I find the difference between Billed and Un-billed Miscelleneous Logs? Where Can I see Un-billed Misc. Logs and which tables. Hari I have a spreadsheet with the PA tables listed in it. Send an email message to charles.zarzour@intergraph.com and I will send you the spreadsheet. I do an excel spreadsheet for each Dictionary. Makes it easy to lookup tables. "Hari" wrote: > Hi, > How can I find the difference between Billed and Un-billed Miscelleneous > Logs? > Where Can I see Un-billed Misc. Logs and which tables. > > Hari > > Can I ...

Help, I cannot Save!
I created a document and locked the worksheet to protect the formulars before creating a template for the document. But now when I open th document and insert a new sheet using the template I created, th document will refuse to save. Once I click on save, office assistant will say "doc not saved". Wha could I have done wrong? PLease help. computerfinema -- computerfinema ----------------------------------------------------------------------- computerfineman's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3716 View this thread: http://www.excelforum.c...

visual basic
Hi, I trying to retrieve values from a table to calculate the 14days average value of a stock closing price. However, i encounter some problem as stated beside the code as follows: Function DaysAvgs() 'Calculate the average value of a given value. Dim db As DAO.Database Dim rst As DAO.Recordset Dim varBookmark As Variant Dim numAve, numDaysAvg As Double Dim intA, intB, lngCount As Integer Set db = CurrentDb 'Open Table Set rst = db.OpenRecordset("SGX Individual Historical", dbOpenTable) rst.MoveFirst Do While Not rst.EOF intA = 1 intB = 0 varBookmark = rst.Bookmark n...

.pdf save as settings
Hi, In Office 2007 Pro is there a way to change the settings such as preventing content copying etc. when saving a file to pdf? I have been trialling Open Office, alongside Office 2007 Pro (full version not a trial), which allows access to these settings but I can't see a way to do it in MS Office. -- Chas MS Office doesn't do that. Chass wrote: > Hi, In Office 2007 Pro is there a way to change the settings such as > preventing content copying etc. when saving a file to pdf? I have been > trialling Open Office, alongside Office 2007 Pro (full version not...

forward to: field
Hi Everyone, im looking for the AD attribute in which the 'forward to:' field of the delivery options is stored. Thank you in advance kind regards marc -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ Its in the altRecipient attribute. -- Mark Fugatt Exchange MVP http://www.exchangetrainer.com http://www.msexchange.org "Marc Wenger" <haga(at).iesg--nspm-noa9h.gmx.ch> wrote in message news:opr64hs7z6fyi4rt@news.microsoft.com... > Hi Everyone, > > im looking for the AD attribute in which the 'forward to:' field of ...

Word2007. Checkbox. No Form
Hello! We have a document (not a form) that we would like to use checkboxes in. This document has a couple of sections where it would be useful if the user could check if something is applicable. We can't protect the whole document. Thank you for your help! Stacey I actually used this feature in a form this morning. Although you don't say what version of Word you are using, you can access the Control Toolbox toolbar in Word 2003, or in Word 2007, it is on Developer tab. To show the developer tab, click the Microsoft Office Button and then click Word Options. S...

Macro for Sharepoint List and another Table?? Same # records?
I am creating a database which we have a form made up of prepopulated data (from a sharepoint list) and also data input needed by a user (for example, comments, etc.). I have two tables: one sharepoint list that is linked to sharepoint website and another table that houses the additional user inputs [table 2]. I have linked the files based on the primary key. So, every record in my table 2 has a plus sign and it will expand and you will see the linked data from the sharepoint list. Is there a way that I can automatically create a record for every corresponding record ...

custom field for projects with tasks past due
I am wondering how/what formula would be needed for creating a custom field at the project level to show when a project has at least one task that is past due. I have a custom field at the task level (IIf([Finish]<[Current Date] And [% Complete]<100,1,2)) that will show when an individual task is overdue, but I want to add a custom field to the Project Center > Summary view to show when a project has any overdue tasks. The PM can then drill down from there into the project and see exactly what tasks are overdue. Once I figure out the formula for this I want to assign ...

changing values of one field based on another
How can I best change the values of one field in a table based on values of another field of the same table. We have an existing table of thousands of entries and I would like to use the following logic to populate a new boolean field. If field1 = "Done" Then BooleanFieldCompleted = True I have some Excel VBA experience but limited Access. I dont want to do this manually! Any assistance appreciated. In general, you'd use an Update query. However, in this case I don't see why you'd need such a field. Why not just create a query with a computed field that returns True...

Getting the BCC field by default.
I would like the BCC field to show by default but cannot find the setting for this in 2007. Anyone know where this is located? In a new message window, use the Options chunk to display the "Show BCC." --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, JC HARRIS asked: | I would like the BCC field to show by default but cannot find the | setting for this in 2007. Anyone know where this is located? Thanks Milly. I had...

I would like to know how to set up a 'fill in the blanks' form?
I would like to set up a templet of sorts to fill in the blanks for certificates. ...

Budget Wont Save
I have have Money 2002 for awhile and have never been able to save a budget and start a new one. I decided to start over with a new file, but once I get all my info back in there, it still won't save. MS has no info in the KB about this. Anyone else have this issue? ...

View original Excel after saving over it
In error, i hit save instead of save as. I'd like to view the original documents contents. is this at all possible. i use windows xp. excel 2003 Not very likely. Try a Google search action if you haven't already, but I think it's impossible. This underscores the importance of backups. -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "houb" wrote: > In error, i hit save instead of save as. I'd like to view the original > documents contents. is this at all possible. i use windows xp. excel 2003 In article <C2A3F0E7-24E0-43A5-809A-ECA719...

Customer check data
When customers pay by check RMS asks for specific information such as drivers license number, routing number, account number, address and phone number. Does anyone have a report and or a way to extract this info from the database for cases when the check is returned for NSF? Please advise, Scott We can write you this report. Contact me for detail on price . Afshin Alikhani - [ afshin@retailrealm.co.uk ] CEO - Retail Realm = = = = = = = = = = "Scott Santorio" <scott@tt-newyork.com> wrote in message news:e8ZKkR6$HHA.3716@TK2MSFTNGP03.phx.gbl... > When customers pa...

How to save Japanese characters in CSV format of Excel ?
Hi, I would like to know, how to save the Doubly-Byte characters.For example, Japanese in CSV of Excel.Here are the steps, I tried. 1. Open Excel 2. Copy pasted the Japanese charactesrs in a cell.It is displaying the characters correctly. 3. Save as CSV(Comma seperated file) It is saving as ??????. Thanks in advance for the info. ...

Saving e-mail & attachments when upgrading
I'm upgrading from NT4 to XP Home and the only data I need to keep are the emails & attachments. I have to format the hard drive to eliminate the partitions. This machine is on a network and I can save to the other machune. Look here for all the information you need on backup and restoration of Outlook data: http://www.slipstick.com/config/backup.htm -- Jocelyn Fiorello MVP - Outlook *** Replies sent to my e-mail address will probably not be answered -- please reply only to the newsgroup to preserve the message thread. *** "Mike" <mike@hosemart.com.au> wrote ...

why does my spell check not work?
My spell check has never worked. What can I do to set it up? In what program / version "karen" <karen@discussions.microsoft.com> wrote in message news:DA8883BD-0958-4AB0-93FF-F43E4FB9D176@microsoft.com... > My spell check has never worked. What can I do to set it up? ...

COUNTIF on Summary Fields
Can't use on a cell that "sums" with arithmetic operators "+". Is there a workaround, etc.? a bit more explanation? -- Don Guillett SalesAid Software donaldb@281.com "DLC" <dlcopesr@yahoo.com> wrote in message news:117v954kaf4s2f6@corp.supernews.com... > Can't use on a cell that "sums" with arithmetic operators "+". Is there a > workaround, etc.? > > ...

Help about numeric type field. Thanks.
I created a SQL Server 2005 CE DB ( .sdf, version 3.0) with vs2005. And I created a table which has 2 fields: fld1 - int, fld2 - numeric(38,25). But I encounted an error messagebox when I tried to insert a record (4005,9000000). The msgbox said Conversion overflows. The setting for my numeric fld2 is (precision=38,scale=25). So why occur error when to insert 9000000? Thanks in advance. ...

item class table
I am creating SOP IM import. I need to fill the distribution fields with a rev account that is part of the item class. I would like to find a table that would hold the item class accounts. I looked in IV40400 and did not see any distribution accounts. What is the best table to pull these accounts. If the accounts have been defined on the Item Class, they will appear on the records in the IV40400 table. They're in the fields IVIVINDX, IVIVOFIX, etc - and they're just the keys to the actual account definitions in the GL00100 table. If a particular account type isn't defined ...

Selecting the Right Text Alignment for a edit box doesn't work
When I select right text alignment in the edit control properties, the text is still left aligned when I run the program. What am I doing wrong Thanks Dan Dan, "Dan" <anonymous@discussions.microsoft.com> a �crit dans le message de news:DECFE605-A130-416B-9924-60BA0C79D684@microsoft.com... > When I select right text alignment in the edit control properties, the text is still left aligned when I run the program. What am I doing wrong? > I've no idea :-))) You can open your RC-file as text, and make sure it has the ES_RIGHT style set, thus: EDITTEXT IDC...

Problems with Money 2006 standard edition
I am unable to switch the budget from Essential to Advanced, I tried the susgestion in the problem solver as found under KB899628 as per below but this did not help. Can anyone help? When you click Use Advanced Budget in Budget Settings in Microsoft Money 2005 or in Microsoft Money 2006, you are taken back to the Essential Budget page instead of to the Advanced Budget page ...