form2 中的datagrid的keydown 中判断keycode=13
form1.show

解决方案 »

  1.   

    在Form_Activate事件里用KeyAscii,完全看不明白。根据你的程序,估计问题不仅仅是处理form2中的回车那么简单。
      

  2.   

    現在不太好給分,等我下班再處理,不過可能用keydown 也不行,因為我把form2中的datagrid 的allowarrow 屬性設為false 后就可以顯出form1, 如為true 則不行,有興趣的朋友可以把代碼copy then debug, i will do as my promise.
    this function to commit the input of erp or anywhere need  input data. i think this is the better way then show all data in db then let user to select (for maybe the db is very large).
    the main question is how to control the other form in one form.
    thank you everybody.
    xinbade
      

  3.   

    与 chen22(chen22)看法相似,应该在Edit.getfocus事件中写那段代码才符合逻辑。form1.show的同时,在form1.active中edit.setfocus,应该在getfocus或者keydown事件中有代码 
    在txt_nor_change中,load form2之后,ado.refresh的操作应该在form2.active中写代码会好一点!
    不过总体来说,逻辑真的比较混乱