private sub cmdsave_click() for j=1 to msflexgrid1.rows - 1 tempcount=0 tempfname="" templname="" for k=1 to msflexgrid1.cols-1 msflexgrid1.row = j msflexgrid1.col = k if trim(msflexgrid1.text) = "" then tempcount=tempcount + 1 if tempcount = 1 and msflexgrid1.col=2 then call prcenterincell exit sub end if else if tempcount = 1 then msflexgrid1.col = 1 call prcenterincell exit sub else if msflexgrid1.col = 1 then tempfname = msflexgrid1.text else templname = msflexgrid1.text end if end if end if next if tempcount <> 2 then text2.text = text2.text + " " + tempfname + " " + templname end if next private sub text1_keypress(keyascii as integer) if keyascii = 13 then msflexgrid1.enabled = true msflexgrid1.text = trim(text1.text) text1.text = "" text1.visible = false if msflexgrid1.col = 1 then msflexgrid1.col = 2 msflexgrid1.setfocus call prcenterincell else msflexgrid1.setfocus end if end if end sub public sub prcenterincell() text1.move msflexgrid1.left + msflexgrid1.cellleft,msflexgrid1.top + msflexgrid1.celltop,msflexgrid1.cellwidth, msflexgrid1.cellheight text1.visible = true text1.text = msflexgrid1.text text1.setfocus text1.selstart = len(text1.text) msflexgrid1.enabled = false end sub