A way to do what Debra is suggesting in a game format is Crate Games, which you can get on DVD.
You said this happens when you are getting ready to leave. Pay attention to exactly what you are doing before you leave and then see how your dog is reacting. You should be able to pick up on the cues that your dog is picking up on. You can try changing the pattern of how you get ready and potentially remove the cue to lessen the behavior until you can build the good associations others described.
visit BCOA on Facebook. http://facebook.com/basenji.org