It loops through all controls on the form, regardless of type. If it's a TextBox or a ComboBox called anything other than SubSubCatComboBox then it checks if it contains a value.
If doesn't then it adds 1 to a variable (ErrCnt) that counts how many errors there are. An error = a blank control that fits the above criteria.
Once it's looped through all the controls, if the error count is more than zero, i.e. it found a blank control, then it will show the message. If the error count = zero then it will perform your code to stamp the data to the worksheet.
If you're adding more Text or Combo boxes that willl need to be checked if they're blank then you shouldn't need to amend the code at all. If they need to be excluded from the error checking then you can add those quite easily to this line:
or as separate IF statements within that IF/END IF block.
Does that help?
BSB
Bookmarks