I have a line of code as follows

If MsgBox("blah...blah....blah.....?", vbYesNo, "Select Output:") = vbNo Then
DoCmd.OutputTo acOutputTable, "tmp_Roster"
DoCmd.OutputTo acOutputTable, "tmp_Roster"
End If

this is compiled into a mde in Access 2003 and it runs okay with Access2003. But when executed in Access2007 it does not run.

What I have observed with Access 2007 is that, if the navigation bar is active and the linked tables are visible in the navigation bar, then it works okay. so to make this line of code work in access2007 i have to refresh the connection to the linked table and then run the code.

What is it that I am doing wrong here?... Please help.