K
Keith Reilly
I made a form in VBA that will open microsoft word start a mail merge
and give it a certian table. the only problem is in my code i have to
write in the location and name of the database. what i want is a dynamic
variable so i can check what the name of the database is and where then
give that to microsoft word. right now if the name changes or its moved
this form is broken. here is the code that needs the variable
objWord.MailMerge.OpenDataSource _
Name:="C:\Program Files\School Database\" & _
"RyeNursery.mdb", _
LinkToSource:=True
so i want
objWord.MailMerge.OpenDataSource _
Name:= strPath & _
strDatabaseName, _
LinkToSource:=True
how do i get the path and database name? is this possible? any help is
appreciated
and give it a certian table. the only problem is in my code i have to
write in the location and name of the database. what i want is a dynamic
variable so i can check what the name of the database is and where then
give that to microsoft word. right now if the name changes or its moved
this form is broken. here is the code that needs the variable
objWord.MailMerge.OpenDataSource _
Name:="C:\Program Files\School Database\" & _
"RyeNursery.mdb", _
LinkToSource:=True
so i want
objWord.MailMerge.OpenDataSource _
Name:= strPath & _
strDatabaseName, _
LinkToSource:=True
how do i get the path and database name? is this possible? any help is
appreciated