LJ is 100% right on this.But a little confusing. The two blacks are together to furnish power to the switch. If you take the switch loose you should see a white on the other side of the switch. This would be your hot leg to the fan/light. To find this in the ceiling,turn the switch on and test with one side on the whitewire and the other to the bare ground. Which ever white is hot will be connected to the black?blue of the fan/light. Let me say to all the do-it-yourself electricians to never run a white wire as a hot leg. Hope this is what is going on there. Ron J.