I too have had this problem with DW 4.0. Can't switch from design view to code view with button or my menu (View->Code) or by closing and reopening DW, even rebooting computer. Even re-created the page anew. Nothing helps.
Found a forum of people with same problem but I see no definitive cures there:
Macromedia does not offer tech support any longer on vers. 4.0.
Advice or suggestions from anyone would be very helpful. Thanks.
Timothy J Sally