Firstly, whenever you swap the connection to the Cable Modem, you *DO* need to power it off for long enough to allow it to lose the association between the MAC address (Media Access Control address) of the Network Adapter or Router and the IP address that it has allocated to it.
After swapping the connection and powering on the Cable Modem, it will recognise (via the MAC address) a new connection and will allocate a different IP address. You will then have internet access.
It seems that the problem you're experiencing is with the *WIRELESS* connection between the computer(s) and the D-Link Router. I'd suggest you try performing a "hard reset" of the router back to its factory default settings and then set it up again from scratch. After doing that, see if you can connect reliably to it with a "wireless" connection.