Subject Re: Sql filter
From Hector Nunez <Zenun.hector@gmail.com>
Date Fri, 08 Aug 2014 20:56:53 -0400
Newsgroups dbase.getting-started

Winston
I don't know exactly what you trying to do but, using Mervyn's form  try this variance .

if file('mbcustid.dbf')
    drop table mbcustid
endif

if not file('mbcustid.dbf')
    create table mbcustid  (custid character(4),cust_name character(15))

    insert into mbcustid  (custid,cust_name) values ("1004","Alpha")
    insert into mbcustid  (custid,cust_name) values ("1005","Bravo")
    insert into mbcustid  (custid,cust_name) values ("1005","Charlie")
    insert into mbcustid  (custid,cust_name) values ("1005","Delta")
    insert into mbcustid  (custid,cust_name) values ("1006","Echo")
endif

     _app.cust_no = "1005"  //placed here as this needs to be set before  the form opens

** END HEADER -- do not remove this line
//
// Generated on 08/08/2014
//
parameter bModal
local f
f = new mbtestForm()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.open()
endif

class mbtestForm of FORM
   with (this)
      onOpen = class::FORM_ONOPEN
      height = 15.1818
      left = 55.8571
      top = 7.3182
      width = 61.8571
      text = "mbcustid"
      scrollBar = 0        // Off
   endwith

   this.COMBOBOX1 = new COMBOBOX(this)
   with (this.COMBOBOX1)
      onChange = class::COMBOBOX1_ONCHANGE
      height = 1.0
      left = 38.0
      top = 5.0
      width = 14.0
      style = 1        // DropDown
   endwith

   this.MBCUSTID1 = new QUERY()
    with (this.MBCUSTID1)
       left = 1.0
       top = 0.5
       sql = 'select * from mbcustid '
       active = true
    endwith



   this.MBCUSTID1 = new QUERY()
    with (this.MBCUSTID1)
       left = 1.0
       top = 0.5
       sql = 'select * from mbcustid '
       active = true
    endwith

    this.MBCUSTID1 = new QUERY()
    with (this.MBCUSTID1)
       left = 1.0
       top = 0.5
       sql = 'select * from mbcustid '
       active = true
    endwith


   this.GRID1 = new GRID(this)
   with (this.GRID1)
      dataLink = form.mbcustid1.rowset
      columns["COLUMN1"] = new GRIDCOLUMN(form.GRID1)
      columns["COLUMN1"].dataLink = form.mbcustid1.rowset.fields["cust_name"]
      columns["COLUMN1"].editorType = 1        // EntryField
      columns["COLUMN1"].width = 8.7143
      columns["COLUMN2"] = new GRIDCOLUMN(form.GRID1)
      columns["COLUMN2"].dataLink = form.mbcustid1.rowset.fields["custid"]
      columns["COLUMN2"].editorType = 1        // EntryField
      columns["COLUMN2"].width = 6.7143
      with (columns["COLUMN1"].editorControl)
         onLeftDblClick = class::EDITORCONTROL_ONLEFTDBLCLICK
      endwith

      with (columns["COLUMN1"].headingControl)
         value = "cust_name"
      endwith

      with (columns["COLUMN2"].headingControl)
         value = "custid"
      endwith

      height = 7.5
      left = 3.0
      top = 3.5
      width = 21.0
   endwith

   this.rowset = this.mbcustid1.rowset



   function COMBOBOX1_onChange

       msgbox("after your selection do the next step.")
       return

   function editorControl_onLeftDblClick(flags, col, row)
      _app.cust_no = form.grid1.columns[2].dataLink.value

      form.a.active = false
      form.a.params['custmno']=  _app.cust_no
      form.a.active = true

      form.COMBOBOX1.dataSource = form.a.rowset.fields["cust_name"]

      return

    function form_onOpen()

       form.a=new query()
       form.a.sql="select * from 'mbcustid.dbf' where custid = :custmno "
       form.a.params['custmno']= '1'
       form.a.active = true


       return

endclass



Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0