Last year I was greatly helped when someone explained how to use GetObject in Word VBA to read data from an Access Form. I have been using it successfully since then. I would now like to do the same with an Access Query. I started by mimicking the code I've been using to read Forms. With the Query “CommentSearch” open, and a record selected, including a field called AbbrevTit, I have been trying the following, which I can’t get to work:
Dim app, tx As String
Set app = GetObject(, "Access.Application")
tx = app.Queries("CommentSearch")![AbbrevTit]
Selection.TypeText Text:=tx
Set app = Nothing
I get ‘Object doesn’t support this property or method’ I tried reading different Fields, then created a simple new Query for the purpose. No joy. Among my References I have Microsoft Forms 2.0 checked and I can’t find an equivalent for Queries so I guess there isn’t one. How do I use GetObject to read data in an Access Query into Word VBA?