如题:
小弟初学vb,望大侠们指教!
小弟初学vb,望大侠们指教!
解决方案 »
- 奇怪现象:WebBrowser1.Document.后面不会自动列出成员表,但是手工输入的成员是可用的,为什么?
- 谁有像VB.Net编辑器中,左侧或右侧的那种触发式菜单控件??
- 小弟求助!在VB+SQL编程中,如何将数据库中某一张表的具体信息添加入下拉列表框?
- 超大數組該怎麼定義呢?
- 请高手看一下:StrConv(84, vbUnicode)=8,如何再把8专成84,谢谢!!!
- 哪有activeskin的中文帮助,或者是教程阿
- 救急!!!如何在DBGrid中显示复选框?
- 求助于字符串搜索!
- 关于安装程序数据源的问题(有点难度)
- 关于VB6数据报表(Data Report)的问题?困扰我很久了!!!
- 帮忙看看,用什么软件好啊!!
- 求助,请问怎么在vb中将Access建立关系??? 在线等
K = Not K
If K = False Then ON_CLICK
End If
End SubPrivate Sub Form_Load()
K = False
End Sub
//你这个问题很奇怪啊选种datagrid的记录直接去点就行了on_click事件是你写的吗?不管是不是直接去call就行了
Call Command1_Click'双击调用Command1的单击事件
'要调用其他时间类似地写就行了: Call 事件名称
End Sub
Private Sub DataGrid1_DblClick()
On Error Resume Next
Dim strsql As String
'向datagrid4中写入数据
txt_fkid.Text = ""
txt_jhid.Text = DataGrid1.Columns(0)
strsql = "select jh_id as ID,dw_mc as 单位名称,jh_sbmc as 设备名称,jh_gg as 规格型号,"
strsql = strsql & " jh_dw as 单位,jh_dj as 单价,jh_sl as 数量,jh_bfsl as 报废数量,jh_btsl as 补套数量,"
strsql = strsql & " jh_ptsl as 配套数量,jh_je as 金额,jh_bfje as 报废金额,jh_btje as 补套金额 ,jh_ptje as 配套金额,"
strsql = strsql & " jh_fl as 设备编码 ,jh_cj as 厂家 ,jh_hb as 货币 ,jh_bz as 备注 ,jh_year as 年份"
strsql = strsql & " from jhtz_dw_view"
strsql = strsql & " where jh_id=" & txt_jhid.Text
Set Db = New Connection
Db.CursorLocation = adUseClient
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\计划管理系统.mdb;Persist Security Info=False"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open strsql, Db, adOpenStatic, adLockOptimistic
Set DataGrid4.DataSource = adoPrimaryRS
DataGrid4.Columns(0).Visible = False
Set Db = Nothing
'如果fk_table里有和txt_jhid匹配的数据,那么在datagrid2中显示
strsql = "select * from jhtz_fk_view where jh_id=" & txt_jhid.Text
Set rs = ExecuteSQL(strsql, msgtext)
If rs.RecordCount > 0 Then
Do While Not rs.EOF
If txt_fkid.Text = "" Then
txt_fkid.Text = rs.Fields("fk_id")
Else
txt_fkid.Text = txt_fkid.Text & "," & rs.Fields("fk_id")
End If
rs.MoveNext
Loop
Else
txt_fkid.Text = ""
End If
strsql = "select fk_id as ID,fk_wczcje_bh as 完成资产流水号,fk_wczcje as 完成资产金额,fk_yfkje_bh as 预付款流水号, fk_yfkje as 预付款金额,fk_fkje_bh as 付款流水号,fk_fkje as 付款金额"
strsql = strsql & " from fk_table"
strsql = strsql & " where jh_id=" & txt_jhid.Text
Set Db = New Connection
Db.CursorLocation = adUseClient
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\计划管理系统.mdb;Persist Security Info=False"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open strsql, Db, adOpenStatic, adLockOptimistic
Set DataGrid2.DataSource = adoPrimaryRS
DataGrid2.Columns(0).Visible = False
Set Db = Nothing
End Sub
不好意思,我说的不清楚!
我不想在datagrid中,删除,修改,添加
我的想法是选中一条纪录后,双击弹出窗体,进行上面我所说的操作!
------------------------------
Private Sub DataGrid1_DblClick()
Form1.Show '双击弹出窗
End Sub