|
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:\software\kordicworks\词典\korea.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
我有一个韩语的ACCESS词典文件,用WORD做了一个FORM(form,command,textbox),想用它当词典用,可用上面的代码查了之后,只能显示一个结果.
有两个问题:一是如何用代码设定主键,只能在ACCESS中设定,在代码中不能指定,设的话老报错;第二就是如何将其它结果插入文档或者显示出来?
我是刚学这个东西,好多东西不懂,请一定要帮忙啊,先谢过了. |
|