I have had similar problems when trying to query workflow status to change views. After far too much time messing around with it I have discovered what was causing our problems. It was simply a case of the filename. It seems when querying between the infopath form and sharepoint it doesnt like spaces in the file name if your trying to pull data ...