|
本帖最后由 sxb2007 于 2010-11-4 14:02 编辑
高难问题求助!
关于加载子窗 源对象 的问题!
用ADO 方式可以为子窗体绑定数据源如下:
Dim rec As New ADODB.Recordset
set me.子窗体.form.Me.Recordset=rec
是关于子窗体源对像的问题
如下图所示:
file:///f:/sss.bmp
怎么用ADO方来替代
Me.Child26.SourceObject = "窗体2"
我用API的方法,做了一下,但速度太慢了,也不能编辑窗体里的数据
Option Explicit
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1
Private Sub 加载子窗体_Click()
Dim mWnd As Long
LockWindowUpdate GetDesktopWindow
DoCmd.OpenForm "窗体2"
mWnd = Forms("窗体2").hwnd
SetParent mWnd, Me.Child26.Form.hwnd
LockWindowUpdate False
DoCmd.SelectObject acForm, "窗体2"
DoCmd.Maximize
End Sub
谢谢大侠能帮我一下!
最后想问一下,除了子窗体控件,还有什么控件可以装载窗体啊!
|
|