From Lisbon: If you come from the airport take the Red line until Alameda metro station and change do the Green line in direction to Campo Grande. When you arrive to Campo Grande, you have the bus station.The bus company that go to Ericeira is Mafrense and the price of the ticket is around 6 eur.
Check the link below to see the schedules:
http://www.mafrense.pt