Switch?

Check the headlight dimmer switch on the floor too. If it goes bad or the connection is loose the dash lights & headlights go out.