Hey all,
I'm having a problem with the below peice of code. You may be familiar with it as it originally came from this site.
Basically Its a BrowseForFile code that opens the browse for file dialogue where you can select a file and the database places the filepath and file name into a field.
What I wouldl ike to do is make thise code public. Here is the code so far...
The setting I use when I call the code are;
strCap = CurrentProject.path
strLoc = me.txtTemplateLoc (the call code is in the same form as this field)
strFolder = "\files\" The folder location of the file I wish to select.
Everything works fine right up to part where I want the filepath and name placed into the me.txtTemplateLoc field. From there it does nothing. Any help would be appreciated
-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
I'm having a problem with the below peice of code. You may be familiar with it as it originally came from this site.
Basically Its a BrowseForFile code that opens the browse for file dialogue where you can select a file and the database places the filepath and file name into a field.
What I wouldl ike to do is make thise code public. Here is the code so far...
Code:
Public Sub Openfile(strCap As String, strLoc As String, strFolder As String)
Dim strTemp As String 'For returning if user cancels
Dim strNewPath 'The new path the user selects
Dim strCaption As String ' What we want the box to say
strCaption = ""
If Not IsNull(strLoc) Then
strTemp = strCap & strFolder
Else
strTemp = strCap & strFolder 'Me.lblPath1.Caption
MsgBox "strTemp " & strCap & strFolder
End If
strCaption = strCap & strFolder
strNewPath = BrowseForFile(strTemp, strCaption)
'playsound (strNewPath)
If IsNull(strNewPath) Or strNewPath = "" Or strNewPath = "\" Then
MsgBox "strTemp " & strTemp & "StrNewpath " & strNewPath, vbOKOnly
strLoc = strNewPath
Else
strLoc = strNewPath
End If
End Sub
The setting I use when I call the code are;
strCap = CurrentProject.path
strLoc = me.txtTemplateLoc (the call code is in the same form as this field)
strFolder = "\files\" The folder location of the file I wish to select.
Everything works fine right up to part where I want the filepath and name placed into the me.txtTemplateLoc field. From there it does nothing. Any help would be appreciated
-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."