Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Pass a value from a field on an Access Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
richardb - 28 Nov 2005 15:43 GMT
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.
richardb - 28 Nov 2005 22:47 GMT
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?

> 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
[quoted text clipped - 8 lines]
> 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.
Helmut Weber - 29 Nov 2005 12:13 GMT
Hi Richard,

see:

http://groups.google.de/group/microsoft.public.word.vba.general/browse_frm/threa
d/e2219e2c1e28fa85/db9d70e6ec240dae?lnk=st&q=access+group%3Amicrosoft.public.wor
d.vba*+author%3Ahelmut+author%3Aweber&rnum=1&hl=de#db9d70e6ec240dae


Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

richardb - 29 Nov 2005 15:35 GMT
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

> Hi Richard,
>
> see:
>
> http://groups.google.de/group/microsoft.public.word.vba.general/browse_frm/threa
d/e2219e2c1e28fa85/db9d70e6ec240dae?lnk=st&q=access+group%3Amicrosoft.public.wor
d.vba*+author%3Ahelmut+author%3Aweber&rnum=1&hl=de#db9d70e6ec240dae

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.