Hi,
I've attached a sample form which shows an error message and disables a control button if the number of rows (with data) is not equal to the number of items specified in the box. To add a formatting rule, you must click the Manage Rules located along the Home Tab, click on the control button or section, click New and select Formatting under the rules task pane, add a condition located at the middle portion of the rules task pane (you may follow the condition I created on the attached form), then select Hide or Disable. Note that the conditions for hiding and disabling controls are inversely proportional in order for it to work properly.
The first condition I added uses a formula count(group2[field2 != ""]) - you may set this by clicking the Use formula, use a count() function, and insert the repeating group inside the parentheses. Also, I added a filter here to make sure that the repeating field should not be blank. You may opt not to add this filter (should not be blank) condition.
The next condition I added is to make sure that the number of repeating rows should be equal/not equal (depending on the format rule) to the number specified in the box.