文本框获得焦点问题
代码如下
lnHandle=SQLConnect(lcODBCName,lcDBUser,lcDBPasswd)If lnHandle>0 &&连接成功 **查询数据) If 1<=SQLExec(lnHandle,"select count(g_zhh) g_zhh from gp_g_xxb where g_zhh='"+Alltrim(Thisform.text11.Value)+"'",'ct3') If ct3.g_zhh<1 Thisform.text11.Value="" thisform.text11.setFocus Messagebox("无此信息 请认真核对",0,"提示") *GRID数据 thisform.grid1.recordsource=null thisform.grid1.refresh else ENDIF else EndifElse &&连接失败 Messagebox("连接SQL SERVER失败",16,"提示")Endif
lnHandle=SQLConnect(lcODBCName,lcDBUser,lcDBPasswd)If lnHandle>0 &&连接成功 **查询数据) If 1<=SQLExec(lnHandle,"select count(g_zhh) g_zhh from gp_g_xxb where g_zhh='"+Alltrim(Thisform.text11.Value)+"'",'ct3') If ct3.g_zhh<1 Thisform.text11.Value="" Messagebox("无此信息 请认真核对",0,"提示") *GRID数据 Thisform.grid1.RecordSource=Null Thisform.grid1.Refresh Thisform.text11.SetFocus Return Else Endif Else EndifElse &&连接失败 Messagebox("连接SQL SERVER失败",16,"提示")Endif