I have a junction box in the ceiling that has two separate main wires coming in. One wire has a black and white plus ground. The other has three wires including red, white and black plus ground.
One of these wires are connected to a nearbye switched outlet. I am assuming it is the three wire (red, black white). My dilemma is I am trying to hook up a light fixture with white and black pus ground and don't know what connects to what.
I tried connecting the two blacks in the box to each other the whites to each other and then to the light fixture white and the red to the black of the fixture. This connects the light and it works however the only way to shut it off is the breaker. The switch does not work. As of right now I have taken the fixture down and connected like colors together, capped them and capped the red alone until I can figure this out. Please help.