If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Importing files from code
I am currently working on a simple stepping stone to store student records.
What I would like to do is setup a form that when a Command Button is pressed, an Open File Dialog box is created. The user can then select the appropriate file and that filename and path is set to a string variable such that I can use the doCmd.TransferText( acImportDelim, .....) Is this possible and if so what is the best method of doing so? Thank you |
#2
|
|||
|
|||
Importing files from code
"Justin Busch" wrote
What I would like to do is setup a form that when a Command Button is pressed, an Open File Dialog box is created. The user can then select the appropriate file and that filename and path is set to a string variable http://www.mvps.org/access/api/api0001.htm describes how to directly use the Windows Common Dialog via its API, and does exactly what you describe. It even has sample code for how to use it. Larry Linson Microsoft Access MVP |
#3
|
|||
|
|||
Importing files from code
"Larry Linson" wrote in message ... "Justin Busch" wrote What I would like to do is setup a form that when a Command Button is pressed, an Open File Dialog box is created. The user can then select the appropriate file and that filename and path is set to a string variable http://www.mvps.org/access/api/api0001.htm describes how to directly use the Windows Common Dialog via its API, and does exactly what you describe. It even has sample code for how to use it. Larry Linson Microsoft Access MVP Thank you for the assist Larry. Just one more quick question, that I hope you or others can answer. How can I set the Dialog Box Title to a specific string of text. |
#4
|
|||
|
|||
Importing files from code
"Justin Busch" wrote in message
... "Larry Linson" wrote in message ... "Justin Busch" wrote What I would like to do is setup a form that when a Command Button is pressed, an Open File Dialog box is created. The user can then select the appropriate file and that filename and path is set to a string variable http://www.mvps.org/access/api/api0001.htm describes how to directly use the Windows Common Dialog via its API, and does exactly what you describe. It even has sample code for how to use it. Larry Linson Microsoft Access MVP Thank you for the assist Larry. Just one more quick question, that I hope you or others can answer. How can I set the Dialog Box Title to a specific string of text. |
#5
|
|||
|
|||
Importing files from code
"Justin Busch" wrote in message
... Thank you for the assist Larry. Just one more quick question, that I hope you or others can answer. How can I set the Dialog Box Title to a specific string of text. The example at http://www.mvps.org/access/api/api0001.htm shows you how: Dim strFilter As String Dim strInputFileName as string strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) sets the title to "Please select an input file..." -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (No private e-mails, please) |
#6
|
|||
|
|||
Importing files from code
"Douglas J. Steele" wrote in message ... "Justin Busch" wrote in message ... Thank you for the assist Larry. Just one more quick question, that I hope you or others can answer. How can I set the Dialog Box Title to a specific string of text. The example at http://www.mvps.org/access/api/api0001.htm shows you how: Dim strFilter As String Dim strInputFileName as string strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) sets the title to "Please select an input file..." -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (No private e-mails, please) Thank you Doug, That worked out perfectly. I was originally trying based on the pop-up fields and resulted with this: strOutputFileNameEnroll = ahtCommonFileOpenSave([OpenFile:=False, Filter:=strFilter, Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY], , , , , , title) Thank you all again! |
Thread Tools | |
Display Modes | |
|
|