Hi,
If you enter the sum of the quantity of all the variants of the product in the quantity field of the main product, the stock of the main product will be updated each time someone purchase a variant of the product and once the stock of the main product reaches 0, if you have the "out of stock" setting turned off in the settings of your products listings menu items/modules the product won't appear on the listings anymore. And if you keep this option turned on, and also have the "add to cart" option activated, then instead of the "choose options" button on the listing, you'll get a "no stock" message there.