You can sin, receive absolution, and accept Communion. That’s not the problem. What is a problem is if you live in a perpetual state of sin, in which case you receive absolution, but as soon as you leave the confessional, you’re back in the state of mortal sin.
So let’s say your sin is that you used the Lord’s name in vain. If you walk into the confessional, and receive absolution, you walk out absolved of that sin and able to accept Communion (unless you used the Lord’s name in vain in the confessional with the priest, in which case you have bigger problems).
Let’s compare that to adultery (you get divorced, and remarried without an annulment). If you walk into the confessional and receive absolution, you’re still an adulterer when you walk out, so you’re absolved of the adultery that occurred before you entered the confessional, but not of the adultery that occurred between when you left the confessional and when Communion is distributed. So you cannot accept Communion as you are in a state of mortal sin (until the situation is rectified and you’ve received absolution).
I don’t presume to know the specific confession that led to the priest’s comment, but if you were not in a perpetual state of sin, and the situation was solely scandal, it means that the priest is concerned that if you accept communion, and therefore present yourself to be free of mortal sin, it could influence others to behave as you do, which would lead them to sin or to the occasion of sin. For example, if you own the local gentleman’s club, and in confession,you tell the priest that the club is closed and will be reopened as a bookstore next week, until you actually change the signs and everyone knows it’s a bookstore, it’s probably not a good idea to accept Communion. Otherwise, you’re sending the message that it’s OK to own a gentleman’s club (and by extension visit or work at a gentleman’s club) and still accept Communion. Once the bookstore opens and everyone knows that you do not own a gentleman’s club, you can accept Communion.
Scandal is a complicated thing, so the best advice is to ask a priest and to do what he says.