Two factors wholly determine a communication link's information transmission rate (measured in in bits per second, or in general, entropy units per unit time):
- Signal to noise ratio; and
- Symbol transmission rate (roughly equivalent to bandwidth).
The first is precisely quantified by Shannon's Noisy Channel Coding Theorem, which I discuss in more detail in my answer here: this tells you how many bits per transmitted symbol you can possibly send. Shannon's theorem is very beautiful insofar that it proves that, as long as this number of bits does not exceed a quantity called the Channel Capacity per symbol, then there must exist a coding scheme that will send those bits for you with arbitrarily small probability of error. That is, if you're willing to make your coding scheme complicated enough by grouping symbols into ever larger words and introducing correlation between them, then you can come as near as you like to perfect communication even in the face of noise (this is what error correcting codes do) And the theorem does this wholly geometrically, without actually having to consider the actual coding scheme used! The theorem also tells you that this bound is precise and tight - if you try to send any arbitrarily small amount of information per symbol greater than the channel capacity, then errors are certain over a big enough word length.
If the noise is Gaussian and linearly additive to the channel, Shannon's theorem becomes the special case of the Shannon-Hartley theorem:
$$C = \frac{1}{2}\log_2(1 + \mathrm{SNR})$$
and this tells you how many bits you can possibly send per symbol (here SNR is a ratio, not expressed in decibels).
The bandwidth then tells you how fast you can send symbols. This is quantified by the Nyquist-Shannon sampling theorem, that one can theoretically send symbols at a rate of $B/2$ symbols per second through a channel of bandwidth $B$.
So: the transmission distance only enters the calculation indirectly: all our practical know mediums degrade signal to noise with distance: radio inflicts the $1/r^2$ intensity loss law on us and optical fibers slowly absorb the light as it propagates along them. You need to work out what a given link's signal to noise ratio will be at the output.
I give a fuller investigation of how the Shannon noisy coding theorem and Shannon-Nyquist theorem can be used to give an estimate for the maximum possible throughput of an optical fiber link in my answer here.