jpkeller55
Technical User
I have a form that has a command button that when clicked will open a specific Word document. The code below is the event procedure On Click. I have about 10 different documents based on the last name of an account and instead of writing this code 10 times for different documents and have ten command buttons, I would like to use a Combo Box to select a last name and have that value drive the query.
For example:
If the last names are:
Anderson
Baker
Johnson
The corresponding Word documents are: Anderson.doc; Baker.doc; Johnson.doc and so on.
I have a query called LastNames that powers the combo box.
Thanks for your help. jpkeller
Code:
Private Sub Command2_Click()
Set Sh = CreateObject("WScript.Shell")
Sh.Run Chr(34) & "W:\JK\Orders\Anderson.doc" & Chr(34)
End Sub
For example:
If the last names are:
Anderson
Baker
Johnson
The corresponding Word documents are: Anderson.doc; Baker.doc; Johnson.doc and so on.
I have a query called LastNames that powers the combo box.
Thanks for your help. jpkeller