|
本帖最后由 todaynew 于 2011-2-18 19:45 编辑
简 发表于 2011-2-18 17:37
我想再问问,如果把子窗体换成列表框,列表框里选中的记录又如何双击复制呢?
Private Sub 表_AfterUpdate()
Dim i As Long
For i = 0 To Me.表.ColumnCount - 1
Me.Controls(Me.表.Column(i, 0)).Value = Me.表.Column(i)
Next
End Sub
Private Sub 确定_Click()
Call 编辑(Me.选项.Value)
End Sub
Sub 编辑(num As Long)
Dim rs As New ADODB.Recordset
Dim ssql As String
Dim i As Long
ssql = "select * from tblGSdengji where 编号=" & Nz(Me.编号.Value, 0)
rs.Open ssql, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If num = 1 Then
rs.AddNew
End If
For i = 1 To rs.Fields.Count - 1
rs(i).Value = Me.Controls(rs(i).Name).Value
Next
rs.Update
rs.Close
Set rs = Nothing
Me.表.Requery
End Sub
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|