Hello,
I am trying to create a form that will open specific PDF's depending on the selection from the combo box.
As I am very new to Access I have had some trouble in achieving this.
I have created a button that will open the location of the files but It doesn't open the actual file.
I am also unsure on how to change which file opens depending on what has been chosen in the combo box.
The **** is where I have inserted the location to the files.
Not sure If I am approaching this the right way or there is a simpler approach.
Apologies If I have posted this in the wrong place.
Thank you.
I am trying to create a form that will open specific PDF's depending on the selection from the combo box.
As I am very new to Access I have had some trouble in achieving this.
I have created a button that will open the location of the files but It doesn't open the actual file.
I am also unsure on how to change which file opens depending on what has been chosen in the combo box.
Code:
Private Sub btnBrowse_Click()
Dim file As FileDialog
Set file = Application.FileDialog(msoFileDialogFilePicker)
file.AllowMultiSelect = False
If file.Show Then
Me.txtFileLocation = file.SelectedItems.Item(1)
End If
Dim strPath As String
'Error check
If IsNull(Me.cmb_DocDes) Then
MsgBox "No document selected", vbOKOnly
'Get path
strPath = DLookup("InfoPDF", "tblQualityProcedures", "ID=" & Me.cmb_DocDes)
Application.FollowHyperlink "****" & strInput
Exit Sub
End If
End Sub
The **** is where I have inserted the location to the files.
Not sure If I am approaching this the right way or there is a simpler approach.
Apologies If I have posted this in the wrong place.
Thank you.