Subject on open problem
From Charlie <tm@tc.com>
Date Sun, 10 Jun 2018 08:01:26 -0400
Newsgroups dbase.getting-started

Hi.. I'm having a problem with when I open this form I have on_open code.  But what happens is it triggers the the grid selchange code which screws everything up.  Is there something I'm doing in the on open code below that is causing this?  Is there something I can do to prevent this from happening?  Should I be using something other than the grid selchange?  Thanks for your help.

The grid selchange is related to the talname table.

function form_onOpen()
           tcost = 0.00
           tsell = 0.00
                //talname = trim(form.talmem1.rowset.fields["talname"].value)
                talname = form.talname1.rowset.fields["lname"].value
                q = form.taldata1.rowset
      cnt = 0
           do while not q.endofset
              z = q.fields["qty"].value * q.fields["cost"].value
              x = q.fields["qty"].value * q.fields["sell"].value
              cnt = cnt + q.fields["qty"].value
         tcost = tcost + z
                   tsell = tsell + x
                        q.next()
                enddo
                form.entryfield1.value := cnt
                form.entryfield3.value := tcost
                form.entryfield4.value := tsell
                form.entryfieldpart_no1.setfocus()
                q.last()
                form.talname1.rowset.findkey(talname)
                form.talname1.rowset.save()
                form.master1.rowset.save()
                set procedure to test.pop additive
                form.popupMenu := new testpopup(form,"testPOPUP")
                return