I am having trouble with this procedure. My situation is almost identical to example #2. I want to populate RecordNumber on my form with a date number like “130001, 130002, etc.” where “13” is the year based on a date automatically generated in the OpenDate field in tblLogRecords. OpenDate is a date/time type field that has a default value of the date the record is created and is not editable. I have added a field called Sequence to tblLogRecords and it is a Number, Long Integer type. I also created a bound control for Sequence on my form. I have a completely separate autonumber field as the PK.
If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

Starting an auto-numbered paragraph is deceptively simple. See those buttons on the top row of the Paragraph section of the Home tab? The left-most one is for bullets; the next two to its right are for numbering and multi-level numbering, respectively. Simply click the button to toggle the feature on, or click on the drop-down arrow on each button to select a specific style. If you don’t like any of the delivered choices, you can click Define New to set your own.
I have now permanently “baked” the Inline Counter system into my InDesign defaults. With no documents open, I made a “Counter” CharStyle and a “Zero Footnote” ParStyle, with those crucial zero-level type size attributes, and selected them in the Document Footnote Options. I also added a blank space as a prefix and a period and a blank space as a suffix. Then I made a keyboard shortcut (Ctrl-Alt-F) for the Footnote/Counter. So now Inline Counters can be inserted anywhere and anytime with close to zero efforts.

2. Yes, The code should be entered using CodeBuilder. Where you enter it depends on how and when you want to trigger the generation of the next number. If you want to use a button, that works. And no, you don’t use 000 in the NZ() function. If you want to DISPLAY at least 3 digits with leading zeros, then you do that in the Format function. Note, though, you will need to change that when you hit 1000 POs. sequentially numbering in publisher