Subject function not working
From Bob McKinney <bmckinney@gmail.com>
Date Wed, 12 Dec 2018 11:02:47 -0500
Newsgroups dbase.getting-started

Hi All: Using db2.8 with wnd/10.  I have a sub form with a date field and a normal entry field that needs to have data entered before proceeding to the rest of the form.  Following that is a container with 3 pb/btn's and 3 numeric entry fields that I wish to disable to enforce the line above. In the form "onOpen" code, I have the following;
**********function code***********
  function BlackOut   // Disables all fields, except action
        // Re-Enable (true) needed fields in selected/field function
      form.ctCk.efckAmt.enabled     = false  //  ct = container,  ef = entry field
      form.ctCk.efDepAmt.enabled   = false    
      form.ctCk.efVisa.enabled        = false
     return
************end function**********

   function form_onOpen
      // This code will be used to see if
      // the forn is being opened properly at all (in the
      // first place -- it's supposed to be called
      // from CheckRegister.wfm) and if so, if we are
      // supposed to be in append or beginEdit. mode...
    form.makeVars() // Create all the memVars
    form.rowset := form.perchecksDatamodule1.pchecks1.rowset
      if type( "form.mode" ) == "C"  // character
         if form.mode == "Append"
            form.rowset.beginAppend()          
            // store the VendNo...
            form.rowset.fields["VendNo"].value := form.VendNo
            // set the default value for Action Date (today's date)
            form.rowset.fields["Action Date"].value := date()
            form.ctCk.EfActionDate.setFocus()          
            form.rowset.refreshControls()
         else
            // find the correct row....
            form.rowset.canNavigate := {|| true }
            form.rowset.indexName   := "Action"  //check nmbr
            form.rowset.findKey( form.action )
            form.rowset.canNavigate := {|| false}
            form.rowset.beginEdit()
         endif
      else
         form.rowset.first()  // just so we're at the top
         msgbox( "You shouldn't run this form except from CheckRegister.wfm",;
                  "Don't do that!", 16)
      endif
      form.blackOut()  // on opening, draws error msg  [ Error:  Data type mismatch.  Expecting:  Object ]

  
***********  end of code   **********


I have used this code "many years" ago successfully, I think, unless the memory has gone south (grin).  
Any help on this greatly appreciated.....Bob