DKY
05-19-2008, 12:58 PM
I have an access database on one of our network drives that has some functions in it. One of the functions looks at data and manipulates it a certain way and I would like to be able to call into my excel files.
The creator of this program constantly uses it in access and is always updating the program. If I were to just simply copy and paste every once in a while I would miss any edits that he makes to the program. Another reason that I want to link to it is because many of us use this program and it would be great if we can just draw from one source.
So far I've got the following:
Sub Run_Func()
Dim obj As Access.Application
Set obj = CreateObject("Access.Application")
With obj
.OpenCurrentDatabase "\\location\to\my\database.mdb"
.Visible = True
.Run "macro1"
End With
obj.Quit
Set obj = Nothing
End Sub
This will run 'macro1' in database.mdb but I can't figure out how to run a function instead. HELP?!?! I'm almost there.....
The creator of this program constantly uses it in access and is always updating the program. If I were to just simply copy and paste every once in a while I would miss any edits that he makes to the program. Another reason that I want to link to it is because many of us use this program and it would be great if we can just draw from one source.
So far I've got the following:
Sub Run_Func()
Dim obj As Access.Application
Set obj = CreateObject("Access.Application")
With obj
.OpenCurrentDatabase "\\location\to\my\database.mdb"
.Visible = True
.Run "macro1"
End With
obj.Quit
Set obj = Nothing
End Sub
This will run 'macro1' in database.mdb but I can't figure out how to run a function instead. HELP?!?! I'm almost there.....