主窗体A 里文本框输入完数据后回车键光标跳到子窗体B的第一个文本框里,在这个文本框里输完数据后 怎么用回车键跳到 C的第一个文本框里???作者: Henry D. Sy 时间: 2008-11-24 20:50
在A窗体输入
Private Sub A_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Me.B_子窗体.Form.B.SetFocus
End If
End Sub
在B子窗体的窗体本身输入
Private Sub A_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "^{tab}"
End If
End Sub作者: Henry D. Sy 时间: 2008-11-24 20:54
晕晕,没注意您的c子窗体的第一个字段是自动编号。
修正一下,加上 Me.Parent.C_子窗体.Form.C.SetFocus
也就是
Private Sub A_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "^{tab}"
Me.Parent.C_子窗体.Form.C.SetFocus
End If
End Sub作者: changweiren 时间: 2008-11-24 21:00
学习dddddd的代码得益不少作者: popo559 时间: 2008-11-25 04:29
多谢指点,,成功了。可是有一点不明白,就是在光标跳转的过程中会自动代开关闭大写开关....作者: Henry D. Sy 时间: 2008-11-25 09:02
没有这回事吧