How can I return the filename and not the whole path? I have inserted my code below.

Sub GetFileName()
Dim filename As String
Dim result As Integer

cdGetFileName.DialogTitle = "Select Fence Picture"
cdGetFileName.Filter = "JPEGS (*.jpg)|*.jpg|All Files (*.*)|*.*"
cdGetFileName.InitDir = App.Path & "\images"
cdGetFileName.ShowOpen
txtPhotoPath = cdGetFileName.filename

End Sub