File Dialog - Stopped Working.

Jun 22, 2005

Hello...

This should be an easy one for many of you..

I have the following to code to let the user select a file..
It worked before but suddenly stopped working...I remember adding some reference but I dont remember exactly the name of the reference..

After I did this, I converted the database from 2000 - 2002/2003 ..back and forth...I did not change/remove any references.

I have access 2003 but my database is in 2000 format because my teammates have 2000.

Thanks in advance for the help.

-------------------------------------------
Dim fDialog As Office.FileDialog
Dim varFile As Variant

' Set up the File Dialog.
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)

With fDialog

' Allow user to make multiple selections in dialog box
.AllowMultiSelect = False

' Set the title of the dialog box.
.Title = "Please select a file"

' Clear out the current filters, and add our own.
'.Filters.Clear
' .Filters.Add "All Files", "*.*"
'.Filters.Add "Access Projects", "*.HTM"
'.Filters.Add "Access Projects", "*.HTML"
'.Filters.Add "Access Projects", "*.DOC"
'.Filters.Add "Access Databases", "*.VST"
'.Filters.Add "Access Databases", "*.VSD"
'.Filters.Add "Access Databases", "*.TXT"
'.Filters.Add "Access Databases", "*.MDB"
'.Filters.Add "Access Projects", "*.XLS"


' Show the dialog box. If the .Show method returns True, the
' user picked at least one file. If the .Show method returns
' False, the user clicked Cancel.
If .Show = True Then

'Loop through each file selected and add it to our list box.
For Each varFile In .SelectedItems
DocsPath_TB.Value = varFile
Next

End If
End With

End Sub
---------------------

View Replies


ADVERTISEMENT

Query Stopped Working

Mar 3, 2006

I made some minor changes in my data entry form, the table and the query form. I believe they are all consistent. But now my query comes up empty no matter which parameters I choose. How do I figure out what went wrong?

View 2 Replies View Related

Forms :: (Upload File) Button Stopped Showing All File Types

Oct 7, 2013

I recently upgraded a DB from 2003 to 2013 and ran into the following problem.

I have a button that opens a file dialog box and allows the user to upload a file to a predetermined location (and store the address as a hyperlink). I borrowed this code from someone else on here and modified it slightly.

In any case, the button still works, but now when it opens it doesn't have an option for "All files" under file types. So I can upload MS Office files, text files, etc., but not PDF files which are by far the most common types my users upload.

Private Sub Command35_Click()
Dim dd As Integer
Dim fileDump As FileDialog
Set fileDump = Application.FileDialog(msoFileDialogOpen)
dd = fileDump.Show
Dim Yourroute As String
Dim yourrouteName
Yourroute = fileDump.SelectedItems(1)
yourrouteName = StrReverse(Yourroute)
yourrouteName = StrReverse(Mid(yourrouteName, 1, InStr(yourrouteName, "") - 1))
FileCopy Yourroute, "us170fp00dataWBO_Tool_RoomDrawings" & yourrouteName
Me.Drawing_Link = yourrouteName & " # us170fp00dataWBO_Tool_RoomDrawings" & yourrouteName
End Sub

View 1 Replies View Related

My Query Stopped Working After 3 Years???

Apr 25, 2005

I have a burron to run a query that auto populates 'start time' with NOW().
It has worked for 3 years and now I get an error message see attached. The only thing I did was change the program fromm 2000 to 2002.

any and all suggestions welcome.

Thanks

View 2 Replies View Related

On Error Suddenly Stopped Working ??

Nov 16, 2007

Hey

This worked fine for some short (but blissfull) time


On Error GoTo MANError

pathbgc = Path & "Man.xls"
DoCmd.TransferSpreadsheet acImport, , "B_Man", pathbgc, vbYes

MANError:
If Err.Number = 3011 Then ExitSub
'--------------------------------------------------------------------------



Now the damn error message pops and says error 3011, can't find the file..
Why isn't On Error stopping it anymore ?
:(

View 9 Replies View Related

Toolbox Functions Stopped Working

Feb 25, 2008

Hi All,

Have a problem with the Toolbox functions when in form design mode; they have suddenly stopped working this afternoon.

For example add button no longer brings up the wizard asking about the various options, combo box wizard no longer appears.

Has anyone encountered this before?

Have tried a reboot but no luck.

Thanks

Hawk

View 2 Replies View Related

Auto Complete Stopped Working

Sep 19, 2006

Access 2003.

Auto complete was working with a combo box. After adding much functionality
to a database I find that auto complete does not work on any combobox in any
form. So I create a blank database and a simple test shows that auto complete
works. When a form from the faulty database is imported in the test database,
auto complete stops working on the test form. Even if the imported faulty
form is removed, auto complete still does not work.

I tried creating a new database and importing the faulty form after removing
all controls and events from the form except for the combo box. Auto complete
still stops working. Not only on the imported form but also on the existing
form which works prior to the import.

I checked auto expand and it is 'Yes' in all conditions.

What ever is causing the problem on the faulty form seems to cause some
property of the database to change.

Is there some database option or property setting that controls auto complete?

Is is possible that importing a form will cause a database property to change?


--
RobGMiller

View 2 Replies View Related

No Records Msgbox Stopped Working

Oct 5, 2006

I am calling a continous form from a combo box on another form. The code below used to warn me that there were no records and shut the form down to avoid showing a blank form.

Private Sub Form_Load()

If IsNull(Me.TxtUnit) Then
MsgBox "There are no operations recorded for this Unit", vbOKOnly, "No Recorded Operations"
DoCmd.Close
End If

End Sub


All was working fine until I changed the properties of the continous form to "Allow Additions = No" to remove the spare blank line at the bottom of the records (just for neatness really).
Now, if there are no records to display, the Me.TxtUnit is not Null anymore. It does not seem to exist. If I hover the mouse over it (in VBA) I get no response at all.

How can I get my Msgbox back please ?

Oscar

View 2 Replies View Related

Access Has Stopped Working When Editing Number Field In Tables

Apr 24, 2013

Access 2013 stops working when I open any table in design mode, and select any field with the type "Number". I can edit Text, Date or Yes/No fields, but not Number ones.

View 7 Replies View Related

Modules & VBA :: File Open Dialog Does Not Allow Selection Of All File Types

Oct 4, 2013

I recently upgraded a DB from 2003 to 2013 and ran into the following problem.

I have a button that opens a file dialog box and allows the user to upload a file to a predetermined location (and store the address as a hyperlink). I borrowed this code from someone else on here and modified it slightly.

In any case, the button still works, but now when it opens it doesn't have an option for "All files" under file types. So I can upload MS Office files, text files, etc., but not PDF files which are by far the most common types my users upload.

Here's my code and a screenshot is attached.

Private Sub Command35_Click()
Dim dd As Integer
Dim fileDump As FileDialog
Set fileDump = Application.FileDialog(msoFileDialogOpen)
dd = fileDump.Show

[Code] ....

View 3 Replies View Related

General :: Open Save File Dialog - Select File From Text Box And Save To Selected Location

Aug 8, 2013

I need code for save dialog file ,and select the file from textbox and save it to the selected location.i have only this code and i dont know what else i can do with this because it just opens the save file dialog !

View 1 Replies View Related

File Browse Dialog Box....

Jun 14, 2006

I have a field in a form to which I wish to be able to browse to a particular PDF file. This location is then to be a hyperlink that when clicked upon, it will open the chosen file.

I have seen a thread already for file browsing, but it said to look at the VBA code, which I have no idea what it means :(

Please help, this is driving me mad.

TIA

RD

View 3 Replies View Related

Open File Dialog

Oct 26, 2006

Another question:

I used the suggested code from this forum to import a file with the open file dialog box. It works great to that point, but how do I specify which table I want it to populate with this data?? Thanks!

Here's the code:

vb Code: Original - vb Code Type tagOPENFILENAMElStructSize As LonghwndOwner As LonghInstance As LongstrFilter As StringstrCustomFilter As StringnMaxCustFilter As LongnFilterIndex As LongstrFile As StringnMaxFile As LongstrFileTitle As StringnMaxFileTitle As LongstrInitialDir As StringstrTitle As StringFlags As LongnFileOffset As IntegernFileExtension As IntegerstrDefExt As StringlCustData As LonglpfnHook As LonglpTemplateName As StringEnd TypeDeclare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As BooleanDeclare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As BooleanDeclare Function CommDlgExtendedError Lib "comdlg32.dll" () As LongGlobal Const ahtOFN_READONLY = &H1Global Const ahtOFN_OVERWRITEPROMPT = &H2Global Const ahtOFN_HIDEREADONLY = &H4Global Const ahtOFN_NOCHANGEDIR = &H8Global Const ahtOFN_SHOWHELP = &H10' You won't use these.'Global Const ahtOFN_ENABLEHOOK = &H20'Global Const ahtOFN_ENABLETEMPLATE = &H40'Global Const ahtOFN_ENABLETEMPLATEHANDLE = &H80Global Const ahtOFN_NOVALIDATE = &H100Global Const ahtOFN_ALLOWMULTISELECT = &H200Global Const ahtOFN_EXTENSIONDIFFERENT = &H400Global Const ahtOFN_PATHMUSTEXIST = &H800Global Const ahtOFN_FILEMUSTEXIST = &H1000Global Const ahtOFN_CREATEPROMPT = &H2000Global Const ahtOFN_SHAREAWARE = &H4000Global Const ahtOFN_NOREADONLYRETURN = &H8000Global Const ahtOFN_NOTESTFILECREATE = &H10000Global Const ahtOFN_NONETWORKBUTTON = &H20000Global Const ahtOFN_NOLONGNAMES = &H40000' New for Windows 95Global Const ahtOFN_EXPLORER = &H80000Global Const ahtOFN_NODEREFERENCELINKS = &H100000Global Const ahtOFN_LONGNAMES = &H200000Function TestIt()Dim strFilter As StringDim lngFlags As LongstrFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda, *.mdb)", _"*.MDA;*.MDB")strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF")strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:", _Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _DialogTitle:="Hello! Open Me!")' Since you passed in a variable for lngFlags,' the function places the output flags value in the variable.Debug.Print Hex(lngFlags)End FunctionFunction GetOpenFile(Optional varDirectory As Variant, _Optional varTitleForDialog As Variant) As Variant' Here's an example that gets an Access database name.Dim strFilter As StringDim lngFlags As LongDim varFileName As Variant' Specify that the chosen file must already exist,' don't change directories when you're done' Also, don't bother displaying' the read-only box. It'll only confuse people.lngFlags = ahtOFN_FILEMUSTEXIST Or _ahtOFN_HIDEREADONLY Or ahtOFN_NOCHANGEDIRIf IsMissing(varDirectory) ThenvarDirectory = ""End IfIf IsMissing(varTitleForDialog) ThenvarTitleForDialog = ""End If' Define the filter string and allocate space in the "c"' string Duplicate this line with changes as necessary for' more file templates.strFilter = ahtAddFilterItem(strFilter, _"Access (*.mdb)", "*.MDB;*.MDA")' Now actually call to get the file name.varFileName = ahtCommonFileOpenSave( _OpenFile:=True, _InitialDir:=varDirectory, _Filter:=strFilter, _Flags:=lngFlags, _DialogTitle:=varTitleForDialog)If Not IsNull(varFileName) ThenvarFileName = TrimNull(varFileName)End IfGetOpenFile = varFileNameEnd FunctionFunction ahtCommonFileOpenSave( _Optional ByRef Flags As Variant, _Optional ByVal InitialDir As Variant, _Optional ByVal Filter As Variant, _Optional ByVal FilterIndex As Variant, _Optional ByVal DefaultExt As Variant, _Optional ByVal FileName As Variant, _Optional ByVal DialogTitle As Variant, _Optional ByVal hwnd As Variant, _Optional ByVal OpenFile As Variant) As Variant' This is the entry point you'll use to call the common' file open/save dialog. The parameters are listed' below, and all are optional.'' In:' Flags: one or more of the ahtOFN_* constants, OR'd together.' InitialDir: the directory in which to first look' Filter: a set of file filters, set up by calling' AddFilterItem. See examples.' FilterIndex: 1-based integer indicating which filter' set to use, by default (1 if unspecified)' DefaultExt: Extension to use if the user doesn't enter one.' Only useful on file saves.' FileName: Default value for the file name text box.' DialogTitle: Title for the dialog.' hWnd: parent window handle' OpenFile: Boolean(True=Open File/False=Save As)' Out:' Return Value: Either Null or the selected filenameDim OFN As tagOPENFILENAMEDim strFileName As StringDim strFileTitle As StringDim fResult As Boolean' Give the dialog a caption title.If IsMissing(InitialDir) Then InitialDir = CurDirIf IsMissing(Filter) Then Filter = ""If IsMissing(FilterIndex) Then FilterIndex = 1If IsMissing(Flags) Then Flags = 0&If IsMissing(DefaultExt) Then DefaultExt = ""If IsMissing(FileName) Then FileName = ""If IsMissing(DialogTitle) Then DialogTitle = ""If IsMissing(hwnd) Then hwnd = Application.hWndAccessAppIf IsMissing(OpenFile) Then OpenFile = True' Allocate string space for the returned strings.strFileName = Left(FileName & String(256, 0), 256)strFileTitle = String(256, 0)' Set up the data structure before you call the functionWith OFN.lStructSize = Len(OFN).hwndOwner = hwnd.strFilter = Filter.nFilterIndex = FilterIndex.strFile = strFileName.nMaxFile = Len(strFileName).strFileTitle = strFileTitle.nMaxFileTitle = Len(strFileTitle).strTitle = DialogTitle.Flags = Flags.strDefExt = DefaultExt.strInitialDir = InitialDir' Didn't think most people would want to deal with' these options..hInstance = 0'.strCustomFilter = ""'.nMaxCustFilter = 0.lpfnHook = 0'New for NT 4.0.strCustomFilter = String(255, 0).nMaxCustFilter = 255End With' This will pass the desired data structure to the' Windows API, which will in turn it uses to display' the Open/Save As Dialog.If OpenFile ThenfResult = aht_apiGetOpenFileName(OFN)ElsefResult = aht_apiGetSaveFileName(OFN)End If' The function call filled in the strFileTitle member' of the structure. You'll have to write special code' to retrieve that if you're interested.If fResult Then' You might care to check the Flags member of the' structure to get information about the chosen file.' In this example, if you bothered to pass in a' value for Flags, we'll fill it in with the outgoing' Flags value.If Not IsMissing(Flags) Then Flags = OFN.FlagsahtCommonFileOpenSave = TrimNull(OFN.strFile)ElseahtCommonFileOpenSave = vbNullStringEnd IfEnd FunctionFunction ahtAddFilterItem(strFilter As String, _strDescription As String, Optional varItem As Variant) As String' Tack a new chunk onto the file filter.' That is, take the old value, stick onto it the description,' (like "Databases"), a null character, the skeleton' (like "*.mdb;*.mda") and a final null character.If IsMissing(varItem) Then varItem = "*.*"ahtAddFilterItem = strFilter & _strDescription & vbNullChar & _varItem & vbNullCharEnd FunctionPrivate Function TrimNull(ByVal strItem As String) As StringDim intPos As IntegerintPos = InStr(strItem, vbNullChar)If intPos > 0 ThenTrimNull = Left(strItem, intPos - 1)ElseTrimNull = strItemEnd IfEnd FunctionPrivate Sub Command20_Click()Dim strFilter As StringDim strInputFileName As StringstrFilter = ahtAddFilterItem(strFilter, "CSV Files (*.csv)", "*.csv")strInputFileName = ahtCommonFileOpenSave( _Filter:=strFilter, OpenFile:=True, _DialogTitle:="Please select an input file...", _Flags:=ahtOFN_HIDEREADONLY)End Sub'This code was originally written by Ken Getz.'It is not to be altered or distributed,'except as part of an application.'You are free to use it in any application,'provided the copyright notice is left unchanged.'' Code courtesy of:' Microsoft Access 95 How-To' Ken Getz and Paul Litwin' Waite Group Press, 1996 Type tagOPENFILENAMElStructSize As LonghwndOwner As LonghInstance As LongstrFilter As StringstrCustomFilter As StringnMaxCustFilter As LongnFilterIndex As LongstrFile As StringnMaxFile As LongstrFileTitle As StringnMaxFileTitle As LongstrInitialDir As StringstrTitle As StringFlags As LongnFileOffset As IntegernFileExtension As IntegerstrDefExt As StringlCustData As LonglpfnHook As LonglpTemplateName As StringEnd Type Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As BooleanDeclare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long Global Const ahtOFN_READONLY = &H1Global Const ahtOFN_OVERWRITEPROMPT = &H2Global Const ahtOFN_HIDEREADONLY = &H4Global Const ahtOFN_NOCHANGEDIR = &H8Global Const ahtOFN_SHOWHELP = &H10' You won't use these.'Global Const ahtOFN_ENABLEHOOK = &H20'Global Const ahtOFN_ENABLETEMPLATE = &H40'Global Const ahtOFN_ENABLETEMPLATEHANDLE = &H80Global Const ahtOFN_NOVALIDATE = &H100Global Const ahtOFN_ALLOWMULTISELECT = &H200Global Const ahtOFN_EXTENSIONDIFFERENT = &H400Global Const ahtOFN_PATHMUSTEXIST = &H800Global Const ahtOFN_FILEMUSTEXIST = &H1000Global Const ahtOFN_CREATEPROMPT = &H2000Global Const ahtOFN_SHAREAWARE = &H4000Global Const ahtOFN_NOREADONLYRETURN = &H8000Global Const ahtOFN_NOTESTFILECREATE = &H10000Global Const ahtOFN_NONETWORKBUTTON = &H20000Global Const ahtOFN_NOLONGNAMES = &H40000' New for Windows 95Global Const ahtOFN_EXPLORER = &H80000Global Const ahtOFN_NODEREFERENCELINKS = &H100000Global Const ahtOFN_LONGNAMES = &H200000 Function TestIt()Dim strFilter As StringDim lngFlags As LongstrFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda, *.mdb)", _"*.MDA;*.MDB")strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF")strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:", _Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _DialogTitle:="Hello! Open Me!")' Since you passed in a variable for lngFlags,' the function places the output flags value in the variable.Debug.Print Hex(lngFlags)End Function Function GetOpenFile(Optional varDirectory As Variant, _Optional varTitleForDialog As Variant) As Variant' Here's an example that gets an Access database name.Dim strFilter As StringDim lngFlags As LongDim varFileName As Variant' Specify that the chosen file must already exist,' don't change directories when you're done' Also, don't bother displaying' the read-only box. It'll only confuse people.lngFlags = ahtOFN_FILEMUSTEXIST Or _ahtOFN_HIDEREADONLY Or ahtOFN_NOCHANGEDIRIf IsMissing(varDirectory) ThenvarDirectory = ""End IfIf IsMissing(varTitleForDialog) ThenvarTitleForDialog = ""End If ' Define the filter string and allocate space in the "c"' string Duplicate this line with changes as necessary for' more file templates.strFilter = ahtAddFilterItem(strFilter, _"Access (*.mdb)", "*.MDB;*.MDA")' Now actually call to get the file name.varFileName = ahtCommonFileOpenSave( _OpenFile:=True, _InitialDir:=varDirectory, _Filter:=strFilter, _Flags:=lngFlags, _DialogTitle:=varTitleForDialog)If Not IsNull(varFileName) ThenvarFileName = TrimNull(varFileName)End IfGetOpenFile = varFileNameEnd Function Function ahtCommonFileOpenSave( _Optional ByRef Flags As Variant, _Optional ByVal InitialDir As Variant, _Optional ByVal Filter As Variant, _Optional ByVal FilterIndex As Variant, _Optional ByVal DefaultExt As Variant, _Optional ByVal FileName As Variant, _Optional ByVal DialogTitle As Variant, _Optional ByVal hwnd As Variant, _Optional ByVal OpenFile As Variant) As Variant' This is the entry point you'll use to call the common' file open/save dialog. The parameters are listed' below, and all are optional.'' In:' Flags: one or more of the ahtOFN_* constants, OR'd together.' InitialDir: the directory in which to first look' Filter: a set of file filters, set up by calling' AddFilterItem. See examples.' FilterIndex: 1-based integer indicating which filter' set to use, by default (1 if unspecified)' DefaultExt: Extension to use if the user doesn't enter one.' Only useful on file saves.' FileName: Default value for the file name text box.' DialogTitle: Title for the dialog.' hWnd: parent window handle' OpenFile: Boolean(True=Open File/False=Save As)' Out:' Return Value: Either Null or the selected filenameDim OFN As tagOPENFILENAMEDim strFileName As StringDim strFileTitle As StringDim fResult As Boolean' Give the dialog a caption title.If IsMissing(InitialDir) Then InitialDir = CurDirIf IsMissing(Filter) Then Filter = ""If IsMissing(FilterIndex) Then FilterIndex = 1If IsMissing(Flags) Then Flags = 0&If IsMissing(DefaultExt) Then DefaultExt = ""If IsMissing(FileName) Then FileName = ""If IsMissing(DialogTitle) Then DialogTitle = ""If IsMissing(hwnd) Then hwnd = Application.hWndAccessAppIf IsMissing(OpenFile) Then OpenFile = True' Allocate string space for the returned strings.strFileName = Left(FileName & String(256, 0), 256)strFileTitle = String(256, 0)' Set up the data structure before you call the functionWith OFN.lStructSize = Len(OFN).hwndOwner = hwnd.strFilter = Filter.nFilterIndex = FilterIndex.strFile = strFileName.nMaxFile = Len(strFileName).strFileTitle = strFileTitle.nMaxFileTitle = Len(strFileTitle).strTitle = DialogTitle.Flags = Flags.strDefExt = DefaultExt.strInitialDir = InitialDir' Didn't think most people would want to deal with' these options..hInstance = 0'.strCustomFilter = ""'.nMaxCustFilter = 0.lpfnHook = 0'New for NT 4.0.strCustomFilter = String(255, 0).nMaxCustFilter = 255End With' This will pass the desired data structure to the' Windows API, which will in turn it uses to display' the Open/Save As Dialog.If OpenFile ThenfResult = aht_apiGetOpenFileName(OFN)ElsefResult = aht_apiGetSaveFileName(OFN)End If ' The function call filled in the strFileTitle member' of the structure. You'll have to write special code' to retrieve that if you're interested.If fResult Then' You might care to check the Flags member of the' structure to get information about the chosen file.' In this example, if you bothered to pass in a' value for Flags, we'll fill it in with the outgoing' Flags value.If Not IsMissing(Flags) Then Flags = OFN.FlagsahtCommonFileOpenSave = TrimNull(OFN.strFile)ElseahtCommonFileOpenSave = vbNullStringEnd IfEnd Function Function ahtAddFilterItem(strFilter As String, _strDescription As String, Optional varItem As Variant) As String' Tack a new chunk onto the file filter.' That is, take the old value, stick onto it the description,' (like "Databases"), a null character, the skeleton' (like "*.mdb;*.mda") and a final null character. If IsMissing(varItem) Then varItem = "*.*"ahtAddFilterItem = strFilter & _strDescription & vbNullChar & _varItem & vbNullCharEnd Function Private Function TrimNull(ByVal strItem As String) As StringDim intPos As IntegerintPos = InStr(strItem, vbNullChar)If intPos > 0 ThenTrimNull = Left(strItem, intPos - 1)ElseTrimNull = strItemEnd IfEnd Function Private Sub Command20_Click() Dim strFilter As String   Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "CSV Files (*.csv)", "*.csv")strInputFileName = ahtCommonFileOpenSave( _Filter:=strFilter, OpenFile:=True, _DialogTitle:="Please select an input file...", _Flags:=ahtOFN_HIDEREADONLY) End Sub 'This code was originally written by Ken Getz.'It is not to be altered or distributed,'except as part of an application.'You are free to use it in any application,'provided the copyright notice is left unchanged.'' Code courtesy of:' Microsoft Access 95 How-To' Ken Getz and Paul Litwin' Waite Group Press, 1996  


Thanks!!

KellyJo

View 1 Replies View Related

Open File Dialog Box

Mar 9, 2007

Hello,

I would like to put a cmdbutton on a form to open the File Dialog box directly from Access whereby users can search through folders and open a any file selected.
I have searched the web and found a link:

http://www.mvps.org/access/api/api0001.htm

I have copied the code into a module and the code behind the cmdbutton but getting an error.
Can anyone help me is finding a solution or an example? Thanks.

View 14 Replies View Related

How To Make A Save File Dialog Box

Jul 16, 2007

I have a problem. This problem is that when I generate the report, I want to show a save file dialog box. How can I do this and and retrict the files show to only "*.pdf" files. I tried it as follow:

Private Sub SaveFile_Click()

Set FDialog = Application.FileDialog(msoFileDialogSaveAs)

With FDialog
.Filters.Add "Acrobat Files", "*.pdf" .Show
End With

End Sub

error is araised when executing .Filters.Add "Acrobat Files", "*.pdf": Object doesnt support property or method.

ALSO How can I pick the path the user selected?

Thanks

View 1 Replies View Related

Trying To Use A Common File DIalog To Update OLE

Dec 1, 2006

I have my form where each records image displays as you scroll through the records. I want to add a control similar to the file dialog control, where users can browse to an image file on their machine, and then preview it and Update it.

Can anyone walk me thru how to do this?

View 1 Replies View Related

General :: Open File In Dialog Box Code

Aug 8, 2013

this cod ein access vba for opening a file dialog and selecting a file in a textbox ..

Private Sub Command26_Click()
Dim fDialog As Object
Set fDialog = Application.FileDialog(msoFileDialogOpen)

[Code]....

this code,on the form i have a button whose click event is this code and a a text box with it which is text29.

It gives an erro

Run time error '2185':

you cant refernce a propery or method for a control unless the control has the focus .

View 1 Replies View Related

Modules & VBA :: Access 2010 File Dialog Box

Feb 11, 2015

I have the following code which successfully opens the dialog box with filters however when I add a function with an Excel import, the filters do not work at all (no files are shown even though they exist in the directory that's opened within the dialog box). If I manually type in the filter (i.e. *.x) it still shows the files.The function at the bottom was provided by cheekybuddha from another form, I'd be lost on getting the Excel file imported into Access.Here's the VBA code (the Function is also included at bottom):

Code:
Private Sub Command0_Click()
On Error GoTo PROC_ERR
Dim strpathtofile As String
Dim strTable As String, strBrowseMsg As String
Dim strFilter As String, strInitialDirectory As String
Dim blnHasFieldNames As Boolean

[code]...

View 2 Replies View Related

Insert Hyperlink Dialog Default File Path

Jan 10, 2007

Hello everyone and happy New year.

Ii have a database running on Access 10.0, I am using the insert hyperlink dialog box (access by Ctrl K) to allow users to insert a hyperlink to a file (could be any sort of file), into a text box.

The problem I have is most of the files are held many directories above where the database is (we have a BAD directory policy, 10's of folders within folders) and it gets a little painful to get the user to go up so many levels, due to the hyperlink dialog opening in the "current folder" view, ie where the db is located.

Simple quest, or so I thought. Can I change the default directory "Current Folder" that the dialog box starts in ?

I have already tried chdir"c:" but to no avail.......not that obvious then...

All help greatfully received...

Any help greatly received......

View 1 Replies View Related

Programming For File Open Dialog In Access Form

Oct 11, 2004

I want to retrieve some parameters from file, So for that i want to implement File Open Dialog
in One of the form. File Open Dialong is available in Micrososft Common Dialog controls.

When i choose Microsoft Common dialog control from extra toolbars, it gives me error saying that "You don't have licence for using Common Control ActiveX.

Any help appreciated.

View 1 Replies View Related

Modules & VBA :: Initial Folder Of Open File Dialog

Apr 27, 2015

I am trying to display an open file dialog window so that the user can pick up a file. I wish the window to show a specific folder. How can I do this? The code I am using is below. The parameter InitialFileName has no effect on the outcome.

Code:
Function GetFileName(strPath As String, imtype As String) As String
On Error GoTo Err_GetFileName
Dim Dlg As FileDialog
Dim sfl As FileDialogSelectedItems
Dim sflitem As Variant
Set Dlg = Application.FileDialog(msoFileDialogFilePicker)

[Code] .....

View 11 Replies View Related

Relink Database With Common File Dialog In Access 2007 W/Password Protection

Jan 9, 2008

All -

Just as the title describes, I can't seem to find a solution to be able to link the front-end to the back-end tables through the common file dialog when the backend is an accdb file that is password encrypted.

See the example attached. Here it should work just fine per the Article at :

http://support.microsoft.com/kb/181076

I've found it works fine without a password encrypted back-end but not with a password encrypted back-end.

Anyone have any ideas? It would be nice to use this feature in Access as well as automating the relinking.

Thanks!

View 1 Replies View Related

Program Working In Access 2007 Not Working In Access 2010 Due To Missing OCX File

Dec 27, 2014

I have a program that runs under access 2007 that I use at my work. We will soon be updating to MS office 2010 and the program will not work now because a calender file .ocx was removed from access 2010. Is there a way to get the 2007 .ocx file to work in access 2010?The program I am using is a relatively simple stand-alone and unsupported app that we use to request patient arrival and departure from various radiology tests inside a hospital. No reports are made from the app other than the number of patient transports for the day.

The app is placed on a common drive accessed from any pc in the hospital. No special permissions are required. But our app does use the calendar, time and date functions in access 2007. When I tried the app on a pc with access 2010, it basically says it (access) cannot open the app because a .ocx file is not present.Is there a way to make the access 2010 calendar file work in access 2007?

View 1 Replies View Related

Possible To Have Multiuser Working On Same Access File?

Feb 8, 2012

Is it possible to have multiuser working on the same Access file?

View 2 Replies View Related

General :: Command Button Not Working In ACCDE File

Oct 19, 2014

I have created an accdb file and saved as an accde file. The accde file opens with a form with command buttons. But the commands buttons do not work with the accde file (they do work with the accdb file). How do I get them working.

View 7 Replies View Related

Modules & VBA :: Shell Command Not Working With Spaces In File Name

Oct 21, 2013

I am in trouble with the shell ocmmand,i have a text box "ExcelPath Location" in which there is a path of excel file i am using below code to open the excel file but it gives an error:

Code:

Private Sub Command11_Click()
Dim str As String
str = ExcelPathLocation.Value
strPath = Dir(str)
Shell "excel.exe" & """" & strPath & """", vbNormalFocus
End Sub

the value of text box is

O:QA FilesQC ReportingPending ReviewB329129)419479_BoxPort_RAMANDEEP BRAR_(10192013.xlsm

it gives run time error : 53 file not found.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved