MS Word mail merge: MERGESEQ and MOD - ms-word

Field codes:
Data:
Expected result:
Actual result:
I was thinking about where I should tweak the codes to fix the issue that the first column of each has three records as other columns do.
Also, a new class name (i.e. 1A, 1B) should be added to the second sheets (i.e. the second and fourth pages).
Thanks in advance for any help!

You need something more like this:
There were two problems - a change of class causes a page break, so at that point you can't rely on on the { =mod({ MERGESEQ },3) } = 0 to show you the right place to break next. Because a column break can also cause a page break, you also have to keep count of the columns to ensure that you can insert the class name every time you have a new page.
An advantage of doing it this way is that you can easily change the number of columns and rows per page.
(I have put one other thing in there, because strictly speaking you need to initialize Class1 when you start the merge).

Related

copy/paste row with event 1 row down and create new event on top of former row with event. The events themselves are text

I hope you will be able to help me.
I need to do the following in Excel:
a. Newest event comes on top and the former event moves 1 row down (below), and;
b. After newest event has been copied and pasted to 1 row down, the first row is clear of any data (blank cells);
c. Now a new event comes on top of the former event. If there is also a new date involved than everything the old events and dates moves at least 2 rows down and leaves a blank row in between. And so on until a full month has been reached;
d. After that the entire sheet/month is copied to an archive.
I've been trying to write the code for this in VBA, but thus far it's not working. To be honest, I can't code and I've trying to do this through youtube and everything I can find online.
I would greatly appreciate any help I can get on this one. I'm new here so I can't a picture just yet. Hopefully somebody understands my questions.
Again thanks for any help on this one.
enter image description here
The picture describes pretty much how I want this to work
I'm answering my own questions, because I sort figured it out and I'm really excited. So the code is not perfect, I know but it works :)
There are two type of code running:
1.
Sub MoveCopyRows()
'Copy and Paste Row
Range("10:10").Copy
Range("11:11").Insert
End Sub
And
2.
Sub CutInsertSheet()
'Cut or Copy and Paste to another worksheet
Worksheets("Overdracht").Range("11:35").Cut
Worksheets("Berichtenhistorie").Range("6:6").Insert
Application.CutCopyMode = False
End Sub
This coding has got me hooked. Now I'm going to see, if I can combine them and if I would be able to change the cell color automatically after adding a new row. Wish me luck everybody! :) And before I forget, thx everybody for your help!

iReport - How to prevent texfield go to next page

I need help!
When Textfield Text is too big and does not fit all the content on the page, it is automatically moved to the next page, can anyone help?
The result is the following:
The structure of the report is as follows:
structure of the report
The expected result would be to completely fill the first page, and then break to next.
You can manage your detail band selecting it and change the property Split type as the following image:
The meanings of three options:
STRETCH:
The band is allowed to split, but never within its declared height. This means the band splits only when its content stretches.
PREVENT:
Prevents the band from splitting on first break attempt. On subsequent pages/columns, the band is allowed to split, to avoid infinite loops.
IMMEDIATE:
The band is allowed to split anywhere, as early as needed, but not before at least one element being printed on the current page/column.
You can see here

MSAccess: Call a summation from a subform (in datasheet view) to be displayed in a textbox on the master form?

Sorry if this question is simple but I have googled and haven't found a satisfactory answer.
I'm creating an engineering cost estimator. I have a form that takes inputs as ISO/Drawing, and for each drawing number are many subforms where you can input ComponentDesc and should spit back out a TotalHours to complete number. I've included a picture (sorry for bad quality)
From the image, the table on the bottom is a subform in datasheet mode (which is usually hidden and located in the footer) which will calculate appropriate Total MH (manhours) for the ComponentDesc inputted into the subform on the right. I would like the small (and incomplete) textboxes to the left (below the title "MH Totals for ISO/Drawings") to display the aggregate total from the subform on the bottom.
I've been trying to use DSUM() to define Control Source for the textbox but it keeps coming back with #ERROR as seen in the textbox to the left. Right now what I have typed out is:
=DSum("[Total MH]","frm-PipingHandleMH")
in the expression builder. [Total MH] being my field and frm-PipingHandleMH being the subform on the bottom. I've tried to put brackets around everything but it didn't work (even though I'm not exactly sure what brackets usually do). Any advice?
DSum (and all domain aggregate functions) acts on a table or query. If you want to use that approach you need to refer to the source of that form and use a filter parameter to limit to appropriate records the I.E. if the form's datasource is qry-PipingHandles and if the form you are trying to sum on currently is showing handles for widget 4 then it would be something like:
=dsum("[Total MH]","qry-PipingHandles","[widgetID] = 4")
Note that if that 4 was the currrent state of form then you need to pass it in, so something like:
=dsum("[Total MH]","qry-PipingHandles","[widgetID] = " & [frm-PipingHandlesMH]![WidgetID].Value)
Where you reference the field in the form and append it onto the string that is applied as a filter to the source for Dsum.
Another approach is to put a subtotal in the footer of the form (iirc you don't actually need to show the footer) and then reference that footer control from the parent form.
Brackets are needed to demarcate names that include spaces or other odd characters, they also can be used (e.g. in query design view) to force Access to treat something as a name rather than a string literal.

Programmatically repeat "Detail" section in Active Reports

I need to repeat a "detail" section, simply repeating the data found in XML, based on the value of one of the XML elements.
Example:
I have a shipped quantity on a line item of 18. There is only one set of data for this in the XML, it is not repeated 18 times. I would like it to display this data 18 times.
Is there a way to programmatically repeat a section? I'm a total novice and i figured for once I'd ask here instead of going to the software vendor, in which case i learn nothing! I tried pouring over the 800+ page manual and couldn't find an answer.
Any solution where I'm not just repeating the detail section is of course welcome!
The report is coded in VB.net, my dataset is XML.
Thanks in advance!
Shawn
I understand your requirement and as per my understanding you wish to repeat the data in the detail section depending on the value of the 'Shipped Quanity'.
If the value is 18, the details section should be repeated 18 times and if ofr the next record the value if 5, the entry for this record should be dispalyed in the report for 5 times.
A cleaner to implement this without repeating the Details Section of the report would be to make use of a subreport.
The flow of the implementation would like the following :
Add a subreport in the Detail section of Report1 (Main Report)
Set it's datasource and add the fields you wish to display
You may remove the ReportHeader/ReportFooter of the subreport and set the height of the PageHeader/Footer to zero
In the Format event of the Detail section fetch and save the value of the 'Shipped Quanity' in some variable (say count).
On the basis of this value,
a. either repeat the Detail Section (number of times=value of count) of the Subreport
b. or render the Subreport multiple times (number equivalent to the value of count)
Regards,
Mohita
I ended up using a counter system and LayoutAction (which i didn't know existed before making this question)
The code ends up looking like this:
int counter = 1;
int skip = 1;
public void Detail_Format() {
if (skip == 1)
{
string convert =((TextBox)rpt.Sections["Detail"].Controls["txtShipQuantity"]).Text.ToString();
counter = int.Parse(convert);
}
if (counter > 1)
{
rpt.LayoutAction = LayoutAction.PrintSection|LayoutAction.MoveLayout;
counter--;
skip = 0;
}
else
{
rpt.LayoutAction = LayoutAction.PrintSection|LayoutAction.MoveLayout|LayoutAction.NextRecord;
skip = 1;
}
}
Thanks!
Shawn

Issue regarding subreprt in active report 7

I want display records in the active reports 7 as 4 record in one page and information that record in the next page?So,I what should use do that?I have tried sub-report and page break but that doesn't work?
Is there any other way to use sub report or any other thing that we can use.
As far my understanding of the issue goes, you want to show 4 records on a page and then show the remaining data on the new page. There isn't any direct way to achieve this.
However a workaround for you is to make use of the If-else loop in the Detail's Format event. Add a counter in the Detail's Format event and when it reaches '4', set the NewPage property of Detail Section to 'After' under the 'If' condition and under the 'Else' part reset the NewPage property of Detail Section to 'None'. 
Please share your observations with us.
Regards,
Mohita