各位高手,请看一下如下的例子怎么改,先谢了!
我有一个很大的韩英词典ACCESS库,想在WORD中做成词典直接查用。我在WORD VBA中做了一个FORM,两个command,想把user表中的111全部显示出来在textbox中或者插入文档中,请各位高手帮忙或予以指点。再次感谢!
另外,有需要韩英词典的朋友,也可直接给我留下EMAIL,我给你们发去。大家一定要帮忙,我急用啊,谢谢!
Private Sub CommandButton1_Click()
Dim docNew As Document
Dim dbNorthwind As DAO.Database
Dim rdShippers As Recordset
Dim intRecords As Integer
Set docNew = ActiveDocument 'Documents.Add
Set dbNorthwind = OpenDatabase _
(Name:="D:\db1.mdb")
Set rdShippers = dbNorthwind.OpenRecordset(Name:="user")
rdShippers.Index = "Korean" '******************只能在ACCESS中设定
rdShippers.Seek "=", TextBox1.Text '************
If rdShippers.NoMatch Then
MsgBox "NO RECORDS"
Else
MsgBox "FIND"
TextBox2.Text = rdShippers.Fields(3).Value
docNew.Content.InsertAfter Text:=rdShippers.Fields(3).Value
rdShippers.MoveNext
docNew.Content.InsertParagraphAfter '********只能插入一个记录,如何把其它记录查出并显示出来啊?
End If
rdShippers.Close
dbNorthwind.Close
End Sub
Private Sub CommandButton2_Click()
End
End Sub
Private Sub UserForm_Click()
End Sub
[此贴子已经被作者于2006-1-20 17:19:47编辑过]
|