Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table buffering error
Message
From
06/11/2001 16:50:17
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00577587
Message ID:
00578240
Views:
37
You're welcome...

The ACTIVATE SCREEN command makes it so the "?" commands will output to the screen behind the form. It can be helpful...and less annoying than messageboxes.

When you did the browse, you saw all of the invoiceLines? So the query works within VFP, but not within the form. hmmm.

Well, next I would put the following in a separate .prg file, from within VFP. Then run the .prg file. Check the product table to see if it worked. You should also see output on the screen for each line that is being changed.

Make sure the product table is open before you run the program.
local lcInvoice_ID, lnCurrentSeason
lnInvoice_ID = 31984   && replace this with a valid invoice number
                       &&     and the correct datatype, of course
lnCurrentSeason = 5

activate screen
set deleted on
Select * from InvoiceDetail Where Invoice_ID = lnInvoice_ID ;
    into cursor InvLinesCursor
? "Records selected: ",_tally
select invLinesCursor
scan   && we are scanning invLinesCursor, not invoiceDetail table
    if indexseek (InvLinesCursor.Product_ID, .t., 'product', 'product_id')
        * product found
        ? "updating product: ",invLinesCursor.Product_ID
        select product
	Replace UseSeason with lnCurrentSeason
    else
        * product not found...error processing here
        * referential integrity is supposed to prevent this
        ? "Error, product not found: ",invLinesCursor.Product_ID
    endif
endscan
Also (this is a sidebar), whenever you run your .exe you should probably issue a CLOSE DATA ALL command inside of VFP first, to make sure there aren't any multiuser issues.


>That code in the command window worked and the record was at the right product.
>
>When I first took over this system from the guy who left the company I used "?" to help debug and it showed up on the form itself. I soon switch to messageboxes. The only time I get anything on the screen is when I enter things in the command window.
>
>The ShowWindow property of the form is "1 - In Top-Level Form".
>
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform