onefootout
Technical User
This is driving me nuts!
I have a button that opens a MS word doc, but I have to enter the string, like so.
Private Sub Command0_Click()
Dim HWordDoc As String
Dim oApp As Object
HWordDoc = "C:\Whatever.doc"
If Dir(HWordDoc) = "" Then
MsgBox "Document Not Found"
Else
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open Filename:=HWordDoc
DoCmd.Maximize
End If
End Sub
How can I make the path string into something dynamic, so a user could pick from a list and populate it? I have a table with path strings and associated names.
I tried using a query to at least pick the right name and path, and maybe set some variable and go from there, but that got me nowhere.
Can I code query commands in onClick events? Should I do this some other way? Arg! I'm just so stinking frustrated.
I have a button that opens a MS word doc, but I have to enter the string, like so.
Private Sub Command0_Click()
Dim HWordDoc As String
Dim oApp As Object
HWordDoc = "C:\Whatever.doc"
If Dir(HWordDoc) = "" Then
MsgBox "Document Not Found"
Else
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open Filename:=HWordDoc
DoCmd.Maximize
End If
End Sub
How can I make the path string into something dynamic, so a user could pick from a list and populate it? I have a table with path strings and associated names.
I tried using a query to at least pick the right name and path, and maybe set some variable and go from there, but that got me nowhere.
Can I code query commands in onClick events? Should I do this some other way? Arg! I'm just so stinking frustrated.