!function(n,t){function r(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function i(e){return void 0===e}if(n){var o={},u=n.TraceKit,s=[].slice,a="?";o.noConflict=function(){return n.TraceKit=u,o},o.wrap=function(e){function n(){try{return e.apply(this,arguments)}catch(e){throw o.report(e),e}}return n},o.report=function(){function e(e){a(),h.push(e)}function t(e){for(var n=h.length-1;n>=0;--n)h[n]===e&&h.splice(n,1)}function i(e,n){var t=null;if(!n||o.collectWindowErrors){for(var i in h)if(r(h,i))try{h[i].apply(null,[e].concat(s.call(arguments,2)))}catch(e){t=e}if(t)throw t}}function u(e,n,t,r,u){var s=null;if(w)o.computeStackTrace.augmentStackTraceWithInitialElement(w,n,t,e),l();else if(u)s=o.computeStackTrace(u),i(s,!0);else{var a={url:n,line:t,column:r};a.func=o.computeStackTrace.guessFunctionName(a.url,a.line),a.context=o.computeStackTrace.gatherContext(a.url,a.line),s={mode:"onerror",message:e,stack:[a]},i(s,!0)}return!!f&&f.apply(this,arguments)}function a(){!0!==d&&(f=n.onerror,n.onerror=u,d=!0)}function l(){var e=w,n=p;p=null,w=null,m=null,i.apply(null,[e,!1].concat(n))}function c(e){if(w){if(m===e)return;l()}var t=o.computeStackTrace(e);throw w=t,m=e,p=s.call(arguments,1),n.setTimeout(function(){m===e&&l()},t.incomplete?2e3:0),e}var f,d,h=[],p=null,m=null,w=null;return c.subscribe=e,c.unsubscribe=t,c}(),o.computeStackTrace=function(){function e(e){if(!o.remoteFetching)return"";try{var t=function(){try{return new n.XMLHttpRequest}catch(e){return new n.ActiveXObject("Microsoft.XMLHTTP")}},r=t();return r.open("GET",e,!1),r.send(""),r.responseText}catch(e){return""}}function t(t){if("string"!=typeof t)return[];if(!r(j,t)){var i="",o="";try{o=n.document.domain}catch(e){}var u=/(.*)\:\/\/([^:\/]+)([:\d]*)\/{0,1}([\s\S]*)/.exec(t);u&&u[2]===o&&(i=e(t)),j[t]=i?i.split("\n"):[]}return j[t]}function u(e,n){var r,o=/function ([^(]*)\(([^)]*)\)/,u=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,s="",l=10,c=t(e);if(!c.length)return a;for(var f=0;f0?u:null}function l(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function c(e){return l(e).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function f(e,n){for(var r,i,o=0,u=n.length;or&&(i=u.exec(o[r]))?i.index:null}function h(e){if(!i(n&&n.document)){for(var t,r,o,u,s=[n.location.href],a=n.document.getElementsByTagName("script"),d=""+e,h=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,p=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,m=0;m]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=n.split("\n"),a=[],l=0;l=0&&(g.line=v+x.substring(0,j).split("\n").length)}}}else if(o=d.exec(i[y])){var _=n.location.href.replace(/#.*$/,""),T=new RegExp(c(i[y+1])),E=f(T,[_]);g={url:_,func:"",args:[],line:E?E.line:o[1],column:null}}if(g){g.func||(g.func=u(g.url,g.line));var k=s(g.url,g.line),A=k?k[Math.floor(k.length/2)]:null;k&&A.replace(/^\s*/,"")===i[y+1].replace(/^\s*/,"")?g.context=k:g.context=[i[y+1]],h.push(g)}}return h.length?{mode:"multiline",name:e.name,message:i[0],stack:h}:null}function y(e,n,t,r){var i={url:n,line:t};if(i.url&&i.line){e.incomplete=!1,i.func||(i.func=u(i.url,i.line)),i.context||(i.context=s(i.url,i.line));var o=/ '([^']+)' /.exec(r);if(o&&(i.column=d(o[1],i.url,i.line)),e.stack.length>0&&e.stack[0].url===i.url){if(e.stack[0].line===i.line)return!1;if(!e.stack[0].line&&e.stack[0].func===i.func)return e.stack[0].line=i.line,e.stack[0].context=i.context,!1}return e.stack.unshift(i),e.partial=!0,!0}return e.incomplete=!0,!1}function g(e,n){for(var t,r,i,s=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,l=[],c={},f=!1,p=g.caller;p&&!f;p=p.caller)if(p!==v&&p!==o.report){if(r={url:null,func:a,args:[],line:null,column:null},p.name?r.func=p.name:(t=s.exec(p.toString()))&&(r.func=t[1]),"undefined"==typeof r.func)try{r.func=t.input.substring(0,t.input.indexOf("{"))}catch(e){}if(i=h(p)){r.url=i.url,r.line=i.line,r.func===a&&(r.func=u(r.url,r.line));var m=/ '([^']+)' /.exec(e.message||e.description);m&&(r.column=d(m[1],i.url,i.line))}c[""+p]?f=!0:c[""+p]=!0,l.push(r)}n&&l.splice(0,n);var w={mode:"callers",name:e.name,message:e.message,stack:l};return y(w,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),w}function v(e,n){var t=null;n=null==n?0:+n;try{if(t=m(e))return t}catch(e){if(x)throw e}try{if(t=p(e))return t}catch(e){if(x)throw e}try{if(t=w(e))return t}catch(e){if(x)throw e}try{if(t=g(e,n+1))return t}catch(e){if(x)throw e}return{mode:"failed"}}function b(e){e=1+(null==e?0:+e);try{throw new Error}catch(n){return v(n,e+1)}}var x=!1,j={};return v.augmentStackTraceWithInitialElement=y,v.guessFunctionName=u,v.gatherContext=s,v.ofCaller=b,v.getSource=t,v}(),o.extendToAsynchronousCallbacks=function(){var e=function(e){var t=n[e];n[e]=function(){var e=s.call(arguments),n=e[0];return"function"==typeof n&&(e[0]=o.wrap(n)),t.apply?t.apply(this,e):t(e[0],e[1])}};e("setTimeout"),e("setInterval")},o.remoteFetching||(o.remoteFetching=!0),o.collectWindowErrors||(o.collectWindowErrors=!0),(!o.linesOfContext||o.linesOfContext<1)&&(o.linesOfContext=11),void 0!==e&&e.exports&&n.module!==e?e.exports=o:"function"==typeof define&&define.amd?define("TraceKit",[],o):n.TraceKit=o}}("undefined"!=typeof window?window:global)},"./webpack-loaders/expose-loader/index.js?require!./shared/require-global.js":function(e,n,t){(function(n){e.exports=n.require=t("./shared/require-global.js")}).call(n,t("../../../lib/node_modules/webpack/buildin/global.js"))}});
To enter specific sequential number codes, such as purchase order numbers, you can use the ROW function together with the TEXT function. For example, to start a numbered list by using 000-001, you enter the formula =TEXT(ROW(A1),"000-000") in the first cell of the range that you want to number, and then drag the fill handle to the end of the range.
One solution is to format the heading with the style and follow it with a hidden paragraph mark. You should format the text in the next paragraph with a style that is not included in the Table of Contents. A hidden paragraph mark keeps the text together on one line when it is printed, even though it is actually two separate paragraphs. The Table of Contents command picks up only those paragraphs with heading styles and places them into the Table of Contents.

Thanks very much for your prompt reply, which reassured me that I was on the right path. From having read various Help topics, I suspected that I'd have to use an Excel data source for the numbers. Fortunately, my knowledge of Excel was good enough to know about the drag and drop facility to create automatic sequential numbering, so the data source creation was easy. In the end, it was the mail merge (no surprises?) which proved a tad tricky, but I got there in the end. I've used MM many times and quite happily in Word documents, but for Publisher label format, it was of course a bit different. The important bit that I had to discover for myself was the significance of, after getting to the Print stage, going into Print options, to Publication & Paper Settings, and selecting Multiple Pages per Sheet (& in my case, also "Single-sided" cos my default of duplex printing had come up). But TA-DA!  All is fine now. Thanks very much again.
Basically, the only difference is that we now maintain a VBA.Collection, and this time we do make use of the UniqueKeyVariant parameter, using it as a key to locate the previously assigned number. If we don’t find it, we add to the VBA.Collection. The SQL to use those 2 functions remains identical. The downside is that if the query generates millions worth of rows, the memory may run out due to a large VBA.Collection. However, if a form is bound to that large dataset, it will likely have several other problems anyway so VBA.Collection should not be a problem for forms that loads a few hundred rows. The other downside is that VBA.Collection will persist indefinitely even long after the query has “finished.” Back to form example, you might need to remember to call the ResetRowNumber() function on a form’s close to ensure that you dispose of the VBA.Collection and free up the memory.
The problem with breaking up chapters into separate stories is, then, when I go to export the book to ePUB, the entire book is no longer in one, continuous stream, so it will not export properly. Also, if there are any edits down the road, and there is text reflow, having chapters in separate stories opens up a HUGE can of worms for pagination! Any ideas?

Regarding exporting to EPUB, I have very limited experience in that department! I understood that InDesign compiles the EPUB using text and image frames in the order they appear in the document? So that chapter 2 would naturally follow chapter 1, and so on? If each chapter is in a separate document and all chapters are linked together using the Book feature, I think you can export to EPUB in a similar way that you can export to PDF?
Law firms use numbered lists daily to prepare contracts, pleadings, letters and memos. Word makes activating and customizing numbering fairly straightforward. You can create simple numbered lists, such as A, B, C and 1, 2, 3. You can also customize these lists to setup specific numbering styles for your firm and practice group. Multilevel lists such as I, A, 1 are handled through Word's Outline Numbering feature, which is explained later in this chapter. Many firms rely on outline numbered lists to draw up contracts and pleadings. Like numbered lists, outline numbered lists can be customized.
You can define a section prefix to label section pages automatically. For example, if you specify A– for Section Prefix on page 16 of a document and include the section prefix, the page will appear in the table of contents or index as A–16. Text you type for a section marker appears when you choose Type > Insert Special Character > Markers > Section Marker.
I make the design with as many up as I need on the master page, linking the frames where the numbers will go. Then I make the list using Excel, copy paste to ID and apply a paragraph style with "start in next frame" option. Click the outbox on the pasted text to get a loaded cursor and delete the frame. Then just shift-click over the first textframe on a live page to have as many "tickets" added as needed automatically.

Add numbers by inserting the same identifier at another location. Alternatively, copy the first one, select it and press “F9” to update the display. As a third option, you can use the keyboard shortcut “Ctrl-F9” and type “SEQ” and your identifier between the braces that appear. For instance, insert “{SEQ mynum}.” Press “F9” to update the field and enable the number to display.
So if you encountered this problem, then you didn’t follow the instructions completely (which is OK) and appear to be automatically generating the number whenever the record is accessed. If that’s the case, then you are risking duplication because you are not saving the generated number immediately. Rather then try to test if a number already exists as you seem to be doing, you should not automatically generate the number, but trigger the generation from some action in the form.

I've also been using NumberPress for about a year and it is awesome. You can easily position numbers as many up per form and as many up on a sheet as you will ever need. Easily change font, color, point size, angle, number of digits and can even customize prefix-ex: instead of No. you can print ABC or a form number. It also does variable data (I've only used a couple of times).Took a little while to learn but is now a piece of cake.
Instead of working harder than you need to, insert a one-column table with as many rows as necessary to accommodate your list. Then, using Word's numbering feature, number that column. Finally, convert the table to text. The resulting list is a fixed numbered list, so you'll have to live with its limitations; when you can do so, this method definitely beats most alternative solutions.