Pass a value from a field on an Access Form

R

richardb

From Word, I want to know the value an object on a form in Access. The
Database is MyDatabase, the form is myForm and the field is txtDateHigh. So
far...

Sub GetDateValue()
Dim myDatabase As Database
txtDatabase As Sring
txtDatabase = "C:\Access Reports\MyDatabase.MDB"
Set myDataBase = OpenDatabase(txtDatabase)
.........
That's as far as I get. Don't know what else to Dim or Set, and could not
find this by searching kb, etc. Would appreciate a hint.
 
R

richardb

As an alternative, is there a way that the Access Code can pass a value to a
procedure in word. For example, I run a procedure with the Access code:

objWord.RunAutoMacro wdAutoOpen

Can this pass a value?
 
R

richardb

Guten Tag Helmut,

This is what I was looking for. I see that the "run" method allows me to
pass arguments. I was trying to use the RunAutoMacro method for wdAutoOpen,
and this did not allow for passing arguments.

The Word job is set up from a form in Access and I want one of the options
from that form sent to Word. My first thought was that Word could read the
object value from the Access form. When I couldn't figure out how to do that,
I turned to sending the value as an argument in RunAutoMacro (instead I will
now send the value as an argument with "run").

Viele danken,

Richard
 

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