In order to join your family or close relative in Sweden, you must have a residence permit. Your application for residence permit should be finalised before entering Sweden.
It is the Swedish Migration Agency that considers your right to a residence permit. For a full description of what rules apply, please visit their website.