Hi all I'm a newbie to this forum and need some advice on my recently bought 1999 r1.
Every time I turn the headlights on I lose all power to the dash and headlights, but if I put the switch to side lights the dash will come back on .
Has anyone got any suggestions as to what's going on.

Had a play with it today at work , the problem seems to come from the headlights , if I unplug them from the bulbs the dash works fine but as soon as I plug either left or right light back in the problem occurs .could this be an earth in need of a clean ?

What it probably is (many R1 owners have had this issue) is corrosion on one of the connectors in the wiring harness for the instrument/headlight cluster, located near the forks.

Take a peek under there, disconnect the two halves and examine the connectors for rust and/or melted plastic.

Ok, so the OP says he loses his dash when the headlights come on. Everything is working but not at the same time. I'll say it again, it sounds like a classic weak battery or charging system problem. What's happening is when the headlights are one, it's drawing down the system and he loses his dash. I've had the same thing happen when I did nothing but put my brake lights on. He could have a bad cell in his battery or a weak charging system. If the OP gets a multimeter and checks his charging system(post #3), more than likely he'll find the problem.