Hello, I hope I can offer you some assistance.
Which engine is fitted to the car? Petrol or diesel and what size?
Let me know and I'll reply as soon as I can.
Ford Focus 1.6 TDCi Zetec. the problem often occurs when I need a little bit extra speed for overtaking, but even when I'm cruising and I go over 3000 rpm the fault occurs
there are a couple of common concerns that will give the symptoms you describe, either a turbo boost problem or by far the most common, a fuel pressure problem.
If the fuel filter hasn't been replaced recently (within the last 6 to 10K) then start with replacing this, it's very common for the filter to block partially, when the engine needs a higher fuel pressure under load it can't be achieved due to the filter, the engine management detects this and this is when you get the engine systems fault and a lack of power, usually when you turn the ignition off and restart the engine the performance rerturns to normal until the fault is detected again.
With a turbo boost pressure concern it's usually an over boost, again this is detected by the engine management and to prevent engine damage the boost is set to zero again giving a lack of power. If this is the case then check the vacuum solenoid operation and also the pipes to it and between it and the turbo.
The only way to confirm the sensor or actuator causing this is to have a diagnostic scan done to retrieve any stored fault codes, any garage can do this so the cost is minimal or if you want to do this on a DIY basis an example of the type of tool you need is http://www.ebay.co.uk/itm/Pro-Fault-Code-Reader-Scan-Tool-Live-Data-Review-Memory-Backup-CAN-BUS-OBD2-EOBD-/161020485355?pt=UK_Diagnostic_Tools_Equipment&hash=item257d919eeb
As I said earlier though if the fuel filter hasn't been replaced recently this would be a good starting point, when the filter is replaced the fuel system will need bleeding.
I hope this helps but if I can assist further let me know and I'll reply as soon as I'm able to.