ModifyGraph Immediately

I have a function where I want to display a graph, modify it a bit and then use prompt/doprompt.
My code is as follows:

Display ...

ModifyGraph ......

Prompt....
DoPrompt....


The problem I have is that the doprompt dialog box comes up before the ModifyGraph executes.
Only after the DoPrompt dialog is released does the graph actually get modified.
This is bad as I need the graoh to be modified first in order to make the prompt/doprompt more useful.
Is there any way around this?
Thanks - I knew it was something easy, I just couldn't remember what it was.