Help me with a wiring problem please!

So I offered to help my mom "fix" some things in her house. While I was doing that, I removed a light fixture (and switch) in the kitchen with plans to just reconnect the new light to the old connections and everything would be great. Well, after I took it down, I didn't get back to it for about a month and now I have absolutely no clue how to hook it back up. My brother and I spend over an hour trying different connections but either it wouldn't come on or it wouldn't shut off.
So here's the scenario: In the switch box, the feed is black and white. Going out of the box, there is a black, white and red. I'm almost positive that the two whites were connected which leaves me with two blacks and red.
In the fixture, I have 4 cables coming in. (3 of them are 14/2 and the one is 14/3). The whites are connected to eachother, the blacks are connected to eachother and the red is hanging loose.
I'm trying to hook up a standard fixture with a dimmer (the dimmer has two unmarked black wires and a ground).
My electrical knowledge is pretty basic (all gained from a book purchased at home depot) and I've thrown my hands up in frustration. I'd rather not hire an electrician to fix this seemingly easy problem. So if anyone could help me, I would appreciate getting out of my mother's bad books :)
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
In your switchbox, connect the two whites together and the two blacks together with a pigtail to the switch(dimmer). Connect the red to the switch (dimmer) In the ceiling box connect all the whites together along with the white from your fixture. Connect all the blacks together and wirenut them. Connect the red to the black from your fixture

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Well whaddya know? That worked. Thank you very much for your quick response!
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Brian, let me clarify: In the switchbox connect the two whites together and cap them. Connect the two blacks together along with one wire from your dimmer and cap them. Connect the red wire along with the second wire from your dimmer and cap it. Then follow the previous instructions

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

HomeOwnersHub.com is a website for homeowners and building and maintenance pros. It is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.