Late Binding in Access Application from Word

P

Paul Reavis

I have an application that I have developed using Word
getting information from a db in Access 2003.

We have 3 versions of Access and Word running in our
organization so I needed to use late binding.

The code populates a drop-down box in Word and for the
2003 version has the Reference to Microsoft DAO 3.6
library and reads like this:


Set db = OpenDatabase(Name:=fGetDBLocation())
Set qdf = db.CreateQueryDef("")
qdf.SQL = strSQL
Set rs = qdf.OpenRecordset()
If rs.EOF Then
strComboName.Item(3).Clear
Else
Do Until rs.EOF
For i = 1 To rs.Fields.Count
strComboName.Item(3).AddItem Text:= _
rs!entry, Index:=i
strComboName.Item(3).ListIndex = 1
Next
rs.MoveNext
Loop
End If

I have at least 2 problems. I have tried CreateObject
construct but then I do not know how to bind the created
instance to the particular database. The other problem is
the GetObject insists on Opening the application and if I
add the construct obj.visible = false then the object
opens in a visible fashion THEN becomes not visible. Also
I am unsure about the Object Model for this process so if
you might point me to something that would help me find
out what I need to construct I would appreciate it.

Thanks so much for your time in reading this any any
insight you might offer.

Paul Reavis
(e-mail address removed)
 
H

Howard Kaikow

If you develop on the system with the lowest version of Word and Access, you
can use the preferred early binding.
You still need to test on all 3 systems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top