Vantage Basic (Getting Screen Value)

Hello,
I normally use the below code to get my screen values and pass them to VB.NET. I started testing SQL Server and I ran into a problem. The code will not complete until SQL Server releases the record. Once I close the Vantage screen I am in, the program fires. I need to figure out how to get my data another way. The below code is ment to read the current record of the Sales Order Detail Screen and pass it as part of the command line to my Visual Basic application. I know for this example I could read the value from the screen but in other examples I can not. For instance. If I need to get the Sales Order Number for the screen I am on, it is nowhere to be found on the Sales Order Dtl Screen. Normally I would use the below method to fetch it from the database.

{v:\mfgsys\vbp/vb.i}
DEFINE VAR data AS CHARACTER.
DEFINE VARIABLE CurPart LIKE OrderDtl.PartNum NO-UNDO.
DEFINE VARIABLE ProgName AS CHARACTER NO-UNDO.
DEFINE VARIABLE ProgOption AS CHARACTER NO-UNDO.
DEFINE VARIABLE hInstanceNum AS INTEGER NO-UNDO.
find OrderDtl where (rowid(OrderDtl) = GetCurrentROWID()) no-lock.
CurPart = OrderDtl.PartNum.
ASSIGN data = GetVantageUserID().
ASSIGN data = data + "~~".
ASSIGN data = data + GetCompanyID().
ASSIGN data = data + "~~".
ASSIGN data = data + CurPart.
ASSIGN data = data + "~~".
ASSIGN ProgName = 'v:\mfgsys\ud\StockStatus2\StockStatus.exe'
ProgOption = data.
RUN v:\mfgsys\lib\ShellExec.r (INPUT ProgName,INPUT ProgOption,OUTPUT hInstanceNum).


Thanks
Jeremy




[Non-text portions of this message have been removed]