| 发表于:2007-05-12 10:47:33 楼主 |
'点查询按钮 private sub cmd1_click() dim strsql as string dim conn as new adodb.connection dim rs as new adodb.recordset strsql = "select 顾客财产一览表.[料号],[日期],[客户名称],[品名],[经手人],[保管人],[是否归还],[预计归还日期],[实际归还日期],[归还人],[备注],顾客财产转出登记表.[转出人],[转出单位],[联系人],[联系人电话],[预计转回日期],[实际转回日期],[接受人] from 顾客财产一览表,顾客财产转出登记表 where [料号] = ' " & text22.text & " ' " if connectdb(conn, gstrconn, 60) <> vbtrue then exit sub rs.open strsql, conn, adopenstatic if not rs.eof then 'text28.text = rs.fields(0) text28.text = rs.fields(1) text26.text = rs.fields(2) text25.text = rs.fields(3) text36.text = rs.fields(4) text31.text = rs.fields(5) text27.text = rs.fields(6) text32.text = rs.fields(7) text37.text = rs.fields(8) text38.text = rs.fields(9) text24.text = rs.fields(10) text29.text = rs.fields(11) text34.text = rs.fields(12) text35.text = rs.fields(13) text40.text = rs.fields(14) text33.text = rs.fields(15) text39.text = rs.fields(16) text30.text = rs.fields(17) else msgbox "没有您要的记录! ", vbokonly + vbinformation, "注意 " end if rs.close set conn = nothing end sub 这是要查询两个表,可是我不知道那里错了。请高手指教~! |
|
|
|
|