Subject Re: Menus Again
From Tony Hughes <tamarak1@bigpond.com>
Date Thu, 06 Aug 2020 00:47:55 -0400
Newsgroups dbase.getting-started

Hi Everyone,

I am not sure what is going on, whether I am around the twist, or I really do have some "Bug", but this is portion of a coded program that has been running for 21 days and executing as expected -" Now" when it comes to the this section an error

"Table "Batch" does not exist " This after I have filled it with Data ?

--------------------------------------------------------------------------------
// This section NOW produces error the above error
// Snippet of code - Prints OK but I now can't Empty Table as I once could ?

Local nAnswer
                
                nAnswer = msgbox("Batch Printout Print OK ?? ", "Correct ", 4 + 32)  
                
                if nAnswer == 6
                
                form.Batch1.active = false

                _app.databases[ 1 ].emptytable ("Batch")
                
                
form.Batch1.active = true
                
                 endif        
                
                set printer off
                
                return
------------------------------------------------------------------------
// from top of this section                
        
choosePrinter()
                _copies=2
                _peject="None"
                _plineno=3
                _pmargin=3
                ingnum = 3
                set printer on
        
                set margin to 10
                
                printjob
                ?        "Allpro Product Formula          " + FormName + Date()
                ?
                ?
                ? "Ingredient Amt" + "  Stock Code " + " Batch Size "
                ?  
                ?
                if pCount > 0
                ?  Ingrval1 Picture "999.999" + "           " + Scode1 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval2 Picture "999.999" + "           " + Scode2 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval3 Picture "999.999" + "           " + Scode3 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval4 Picture "999.999" + "           " + Scode4 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval5 Picture "999.999" + "           " + Scode5 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval6 Picture "999.999" + "           " + Scode6 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval7 Picture "999.999" + "           " + Scode7 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval8 Picture "999.999" + "           " + Scode8 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval9 Picture "999.999" + "           " + Scode9 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval10 Picture "999.999" + "           " + Scode10 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval11 Picture "999.999" + "           " + Scode11 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval12 Picture "999.999" + "           " + Scode12 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval13 Picture "999.999" + "           " + Scode13 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval14 Picture "999.999" + "           " + Scode14 + "         " + BatchSize
                pCount = pCount - 1
                endif
                ?
                if pCount > 0
                ?  Ingrval15 Picture "999.999" + "           " + Scode15 + "         " + BatchSize
                pCount = pCount - 1
                endif
          
        
                endprintjob

                close printer
-------------------------------- Error in this section                
                
Local nAnswer
                
                nAnswer = msgbox("Batch Printout Print OK ?? ", "Correct ", 4 + 32)  
                
                if nAnswer == 6
                
                form.Batch1.active = false

                _app.databases[ 1 ].emptytable ("Batch")

// error "Table Batch does no exist"                
                
form.Batch1.active = true
                
                 endif        
                
                set printer off
                
                return
                
                else
                msgbox(" No Batch Report to Print ?? ")  // if rCount = 0
                endif
                return




                
--------------------------------------------------------------------------


Tony Hughes Wrote:

> Hi all you helpful people,
>
> I am still bewildered as I have tried all the cures so far an all fail.
>
> If I double click mbcdisplay.wfm in the mbcdisplay folder on my desk top, it runs without a problem. If I double click mbcmenu.wfm in mbcdisplay folder it runs OK also, but one can't seem to find the other one in the same folder ?. As I said before I have another program called Allpro. In the Allpro folder I have Alpromenu.wfm and this finds Allproemp.wfm, AllproRaws.wfm, Allprotest.wfm, without any problems.
> Could the mbcdisplay problem stem from the fact they both have similar names. I really do not seem to be able to discover any difference, but one runs the other does not ?
>
> Tony Hughes