I wan to browse a directory and select a file and transfer the data to an ms-access table. I'm looking for VB code in MS-Access 2007.
I wan to browse a directory and select a file and transfer the data to an ms-access table. I'm looking for VB code in MS-Access 2007.
I split your question off from thread you attached it to. One way to select a file:
http://access.mvps.org/access/api/api0001.htm
yes, load pbaldy's code as a class called cCommonDialog.
Then your code can say:
vFile = UserPickFile("X") '(X is my code for Excel files, T=text files, etc)
Code:Public Function UserPickFile(ByVal pvFilter, Optional pvPath) Dim clsCmn As New cCommonDialog Dim vFile With clsCmn.InitDir = pvPath .FilterCode = pvFilter .ShowSave UserPickFile = .FilenameEnd With Set clsCmn = Nothing End Function
Last edited by ranman256; 04-28-2014 at 01:52 PM. Reason: code box