|
下面一段代码中“红字部分”,要求字段类型为数值型,如果为“字符型”时就不能运行,
能否将“=”改为“like”
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim lRows As Long
Dim I As Long
If KeyCode = 116 Then
If MsgBox("您确定要复制 " & SelHeight & " 条数据吗?", vbExclamation + vbYesNo) = vbNo Then Exit Sub
lRows = Me.SelHeight ' 选定的行数
DoCmd.Echo False
For I = lRows To lRows
CurrentDb.Execute "INSERT INTO Tbl2 ( A, B, C ) SELECT Tbl1.A, Tbl1.B, Tbl1.C FROM Tbl1 WHERE Tbl1.ID=" & Me.ID & ";"
Me.Recordset.MoveNext
Next
Forms!copyform.sFrm2.Form.Requery
DoCmd.Echo True
End If
End Sub
[ 本帖最后由 wktt6833 于 2008-2-5 21:31 编辑 ] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|