Solved

MISSING MS OFFICE 10.0 Object Library

Posted on 2004-08-05
45
1,876 Views
Last Modified: 2007-10-18
I'm trying to run this module in MS Access v. 2000.

Public Sub GetDir_Click()
    Dim sFile As String, sDir As String
    Dim result As Integer
    With Application.FileDialog(msoFileDialogFilePicker)
        .Title = "Select File"
        .Filters.Add "All Files", "*.*"
        .FilterIndex = 3
        .AllowMultiSelect = False
        .InitialFileName = CurrentProject.Path
        result = .Show
        If (result <> 0) Then
            sFile = Trim(.SelectedItems.Item(1))
            sDir = Dir$(sFile, vbDirectory)
        End If
    End With
End Sub

But I get a "Can't find project or Library" on msoFileDialogFilePicker.  So I look at the references and there is a "MISSING" next to Office 10.0 Object Library.  But, I don't see 10.0 as an option for me, I see 9.0 there but not 10.0.  This code works fine in Access 2002.

Is there anything I can do to tweak it to work with Access 2000?

Thanks!
0
Comment
Question by:Ingx_Sub
  • 22
  • 18
  • 3
  • +2
45 Comments
 
LVL 13

Expert Comment

by:lucas911
ID: 11729183
Office 2002 is 10
Office 2000 is 9

So it will look for references based on which version you run.  You would have to either 1.  Change your references manually 2. Do it programatically (if possible)
0
 

Expert Comment

by:Mark-VII
ID: 11729204
My gut reaction is it's choking on FileDialog.  I don't recognize that one as valid in Office 2000.

My favorite way to get a File Open dialog is to use Excel's GetOpenFileName in my VBA code.  (I know it sounds weird to use an Excel dialog in Access logic, but I find it easier than API calls.)  If you bring up VBA editor in Excel and search under GetOpenFileName, the explanation is pretty good.  One thing to be sure of, though, is to go into Tools, References in Access and set a reference to Excel if you don't have one already.

Mark
0
 

Author Comment

by:Ingx_Sub
ID: 11729209
How do I change it manually?
0
 
LVL 13

Expert Comment

by:lucas911
ID: 11729229
Pick MS Office 9.....uncheck office 10....run it again
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11729314
So lucas911 had it right
Office 2002 is 10
Office 2000 is 9

This alone will NOT solve your issue though!
This >> FileDialog(msoFileDialogFilePicker)
is a 2002 function that is NOT available in 2000!

You will have to use VBA to create the filedialogpicker.

Cheers
M
0
 
LVL 26

Expert Comment

by:dannywareham
ID: 11729319
You can download the reference from MS, but there's not much point if you have 9.0
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11729350
Here's a link for you.

API: Call the standard Windows File Open/Save dialog box
http://www.mvps.org/access/api/api0001.htm

Cheers
Michael
0
 

Author Comment

by:Ingx_Sub
ID: 11729356
didn't work Lucas, I'll try the Excel thing
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11729398
Ingx_Sub,

I do not think You will be able to do this in 2000.  It's not that simple.
You will need to follow the link I provided, copy and paste the code into a new Module
then Call GetOpenFile function from a command button on your form.

Cheers
Michael
0
 
LVL 13

Expert Comment

by:lucas911
ID: 11729403
Yah i tried that myself... ;-(

damn
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11729528
I have 2002 at my office at home and I learned this the hard way when I delivered a test version to a Client who was running 2000.
When we tested this function I was using the same as Ingx_Sub  initially >>FileDialog(msoFileDialogFilePicker)

For any version prior to 2002  (so 2000 and previous) you HAVE to use the Module shown in the link I provided.
>>API: Call the standard Windows File Open/Save dialog box
>>http://www.mvps.org/access/api/api0001.htm

It works great!  You don't need to understand it to use it - just paste it into a module and reference the "GetOpenFile" function from a command button using
Call GetOpenFile
from a command button on your form.

Cheers
Michael
0
 

Author Comment

by:Ingx_Sub
ID: 11729714
Ok, I'm not very good at this.  Do I do it like this then?

Private Sub GetDir_Click()
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 String
Dim lngFlags As Long
Dim 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_NOCHANGEDIR
    If IsMissing(varDirectory) Then
        varDirectory = ""
    End If
    If IsMissing(varTitleForDialog) Then
        varTitleForDialog = ""
    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) Then
        varFileName = TrimNull(varFileName)
    End If
    GetOpenFile = varFileName
End Function
End Function

I ask because obviously it didn't work :(
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11729927
Hey Ingx_Sub,

So you need to go to your "Modules" tab in the database window.
Then click "New" to create a new module.

This will open the VBA window for your new module.
Then just Paste this code (YES - ALL OF IT!)

'***************** Code Start **************
'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 tagOPENFILENAME
    lStructSize As Long
    hwndOwner As Long
    hInstance As Long
    strFilter As String
    strCustomFilter As String
    nMaxCustFilter As Long
    nFilterIndex As Long
    strFile As String
    nMaxFile As Long
    strFileTitle As String
    nMaxFileTitle As Long
    strInitialDir As String
    strTitle As String
    Flags As Long
    nFileOffset As Integer
    nFileExtension As Integer
    strDefExt As String
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
End 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 Boolean
Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long

Global Const ahtOFN_READONLY = &H1
Global Const ahtOFN_OVERWRITEPROMPT = &H2
Global Const ahtOFN_HIDEREADONLY = &H4
Global Const ahtOFN_NOCHANGEDIR = &H8
Global Const ahtOFN_SHOWHELP = &H10
' You won't use these.
'Global Const ahtOFN_ENABLEHOOK = &H20
'Global Const ahtOFN_ENABLETEMPLATE = &H40
'Global Const ahtOFN_ENABLETEMPLATEHANDLE = &H80
Global Const ahtOFN_NOVALIDATE = &H100
Global Const ahtOFN_ALLOWMULTISELECT = &H200
Global Const ahtOFN_EXTENSIONDIFFERENT = &H400
Global Const ahtOFN_PATHMUSTEXIST = &H800
Global Const ahtOFN_FILEMUSTEXIST = &H1000
Global Const ahtOFN_CREATEPROMPT = &H2000
Global Const ahtOFN_SHAREAWARE = &H4000
Global Const ahtOFN_NOREADONLYRETURN = &H8000
Global Const ahtOFN_NOTESTFILECREATE = &H10000
Global Const ahtOFN_NONETWORKBUTTON = &H20000
Global Const ahtOFN_NOLONGNAMES = &H40000
' New for Windows 95
Global Const ahtOFN_EXPLORER = &H80000
Global Const ahtOFN_NODEREFERENCELINKS = &H100000
Global Const ahtOFN_LONGNAMES = &H200000

Function TestIt()
    Dim strFilter As String
    Dim lngFlags As Long
    strFilter = 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 String
Dim lngFlags As Long
Dim 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_NOCHANGEDIR
    If IsMissing(varDirectory) Then
        varDirectory = ""
    End If
    If IsMissing(varTitleForDialog) Then
        varTitleForDialog = ""
    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) Then
        varFileName = TrimNull(varFileName)
    End If
    GetOpenFile = varFileName
End 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 filename
Dim OFN As tagOPENFILENAME
Dim strFileName As String
Dim strFileTitle As String
Dim fResult As Boolean
    ' Give the dialog a caption title.
    If IsMissing(InitialDir) Then InitialDir = CurDir
    If IsMissing(Filter) Then Filter = ""
    If IsMissing(FilterIndex) Then FilterIndex = 1
    If 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.hWndAccessApp
    If 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 function
    With 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 = 255
    End 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 Then
        fResult = aht_apiGetOpenFileName(OFN)
    Else
        fResult = 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.Flags
        ahtCommonFileOpenSave = TrimNull(OFN.strFile)
    Else
        ahtCommonFileOpenSave = vbNullString
    End If
End 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 & vbNullChar
End Function

Private Function TrimNull(ByVal strItem As String) As String
Dim intPos As Integer
    intPos = InStr(strItem, vbNullChar)
    If intPos > 0 Then
        TrimNull = Left(strItem, intPos - 1)
    Else
        TrimNull = strItem
    End If
End Function
'************** Code End *****************

Now save the code and Name the Module "basGetOpenFile"
Then you should do a "Debug" and "Compile" from the Tools menu.


Now on your form you could have a command button - I think you called your "GetDir"
In the "OnClick" Event all you do is paste this

Private Sub GetDir_Click()

    Call GetOpenFile

End Sub

So give that a try and let me know where you end up.
There might be one small piece to add.

Good luck!
Let me know how it goes!
Cheers
Mcihael
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11729937
Heading out for lunch now and will check in when I get back!

Chow!
M
0
 

Author Comment

by:Ingx_Sub
ID: 11730271
Ok that kinda worked.  I can now get the File Picker to show up, but it will only let me look for access databases.  I need to find text files.
0
 

Author Comment

by:Ingx_Sub
ID: 11730403
Ok, I got it to allow me to pick the text files by changing part of the code:

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 String
Dim lngFlags As Long
Dim 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_NOCHANGEDIR
    If IsMissing(varDirectory) Then
        varDirectory = ""
    End If
    If IsMissing(varTitleForDialog) Then
        varTitleForDialog = ""
    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, "Text Files (*.txt)", "*.TXT")
   
    ' Now actually call to get the file name.
    varFileName = ahtCommonFileOpenSave( _
                    OpenFile:=True, _
                    InitialDir:=varDirectory, _
                    Filter:=strFilter, _
                    Flags:=lngFlags, _
                    DialogTitle:=varTitleForDialog)
    If Not IsNull(varFileName) Then
        varFileName = TrimNull(varFileName)
    End If
    GetOpenFile = varFileName
End Function

I put this line in there:  strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")

Now when I click my "Import Text" button, I get an "Unrecognized File Format" message.  Huh??
0
 

Author Comment

by:Ingx_Sub
ID: 11730580
So, it's like the code has now made the files unrecognizeable.  :(
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11730851
No problem.
all you need to do is tell the code what file extensions you want to filter.

Look for this Function in the Code...
Function GetOpenFile(Optional varDirectory As Variant, _

and scroll down to this line...
   strFilter = ahtAddFilterItem(strFilter, _
                "Access (*.mdb)", "*.MDB;*.MDA")

Change it to this
    strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")

OR this
    strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")

This is just filtering what files you want to view...

Let me know how that works
Cheers
Michael
0
 

Author Comment

by:Ingx_Sub
ID: 11730923
Isn't that what I did?
0
 

Author Comment

by:Ingx_Sub
ID: 11730984
This is the VB code of my form:

Option Compare Database
Option Explicit

Private Sub cmdExit_Click()
    Form_SelectDir.Visible = False
End Sub

Private Sub cmdImport_Click()
    ImportText
    MsgBox "Text files have been imported."
End Sub




Private Sub GetDir_Click()

    Call GetOpenFile

End Sub


I don't think the File Picker is working correctly.  When I go through the picker, this is where the files should be pulling from:

H:\UCare

But when I click the Import button and get the file location verification window, it tells me that it's going to download the files from:

c:\Documents and Settings\IngxSub\My Documents.  

This is NOT the location I picked via the File Picker.

Any ideas?
0
 

Author Comment

by:Ingx_Sub
ID: 11731014
Just for clarification purposes, this is the code I have:

Option Compare Database

'***************** Code Start **************
'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 tagOPENFILENAME
    lStructSize As Long
    hwndOwner As Long
    hInstance As Long
    strFilter As String
    strCustomFilter As String
    nMaxCustFilter As Long
    nFilterIndex As Long
    strFile As String
    nMaxFile As Long
    strFileTitle As String
    nMaxFileTitle As Long
    strInitialDir As String
    strTitle As String
    Flags As Long
    nFileOffset As Integer
    nFileExtension As Integer
    strDefExt As String
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
End 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 Boolean
Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long

Global Const ahtOFN_READONLY = &H1
Global Const ahtOFN_OVERWRITEPROMPT = &H2
Global Const ahtOFN_HIDEREADONLY = &H4
Global Const ahtOFN_NOCHANGEDIR = &H8
Global Const ahtOFN_SHOWHELP = &H10
' You won't use these.
'Global Const ahtOFN_ENABLEHOOK = &H20
'Global Const ahtOFN_ENABLETEMPLATE = &H40
'Global Const ahtOFN_ENABLETEMPLATEHANDLE = &H80
Global Const ahtOFN_NOVALIDATE = &H100
Global Const ahtOFN_ALLOWMULTISELECT = &H200
Global Const ahtOFN_EXTENSIONDIFFERENT = &H400
Global Const ahtOFN_PATHMUSTEXIST = &H800
Global Const ahtOFN_FILEMUSTEXIST = &H1000
Global Const ahtOFN_CREATEPROMPT = &H2000
Global Const ahtOFN_SHAREAWARE = &H4000
Global Const ahtOFN_NOREADONLYRETURN = &H8000
Global Const ahtOFN_NOTESTFILECREATE = &H10000
Global Const ahtOFN_NONETWORKBUTTON = &H20000
Global Const ahtOFN_NOLONGNAMES = &H40000
' New for Windows 95
Global Const ahtOFN_EXPLORER = &H80000
Global Const ahtOFN_NODEREFERENCELINKS = &H100000
Global Const ahtOFN_LONGNAMES = &H200000

Function TestIt()
    Dim strFilter As String
    Dim lngFlags As Long
    strFilter = 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 String
Dim lngFlags As Long
Dim 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_NOCHANGEDIR
    If IsMissing(varDirectory) Then
        varDirectory = ""
    End If
    If IsMissing(varTitleForDialog) Then
        varTitleForDialog = ""
    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, "Text Files (*.txt)", "*.TXT")
   
    ' Now actually call to get the file name.
    varFileName = ahtCommonFileOpenSave( _
                    OpenFile:=True, _
                    InitialDir:=varDirectory, _
                    Filter:=strFilter, _
                    Flags:=lngFlags, _
                    DialogTitle:=varTitleForDialog)
    If Not IsNull(varFileName) Then
        varFileName = TrimNull(varFileName)
    End If
    GetOpenFile = varFileName
End 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 filename
Dim OFN As tagOPENFILENAME
Dim strFileName As String
Dim strFileTitle As String
Dim fResult As Boolean
    ' Give the dialog a caption title.
    If IsMissing(InitialDir) Then InitialDir = CurDir
    If IsMissing(Filter) Then Filter = ""
    If IsMissing(FilterIndex) Then FilterIndex = 1
    If 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.hWndAccessApp
    If 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 function
    With 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 = 255
    End 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 Then
        fResult = aht_apiGetOpenFileName(OFN)
    Else
        fResult = 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.Flags
        ahtCommonFileOpenSave = TrimNull(OFN.strFile)
    Else
        ahtCommonFileOpenSave = vbNullString
    End If
End 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 & vbNullChar
End Function

Private Function TrimNull(ByVal strItem As String) As String
Dim intPos As Integer
    intPos = InStr(strItem, vbNullChar)
    If intPos > 0 Then
        TrimNull = Left(strItem, intPos - 1)
    Else
        TrimNull = strItem
    End If
End Function
'************** Code End *****************


0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11731041
Give me a few...

We need to do one more thing here and I can help with that in a few minutes...

Cheers
M
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Ingx_Sub
ID: 11731054
Ok, thanks, I appreciate it.
0
 

Author Comment

by:Ingx_Sub
ID: 11731376
I'm heading home for the evening.  Will pick this up first thing in the morning.

Thanks.
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11731484
Sorry been absolutely swamped here at work!
The phone WON'T stop ringing!

It's like they expect me to work while I'm here or something??  go figure...

SO in this part of the code...

    ' Now actually call to get the file name.
    varFileName = ahtCommonFileOpenSave( _
                    OpenFile:=True, _
                    InitialDir:=varDirectory, _
                    Filter:=strFilter, _
                    Flags:=lngFlags, _
                    DialogTitle:=varTitleForDialog)
    If Not IsNull(varFileName) Then
        varFileName = TrimNull(varFileName)
    End If
    GetOpenFile = varFileName
End Function


I added this to one of my applications...

Dim strParentFormName As String                 'This needs to be declared at the start of the code with the other variables
strParentFormName = CurrentObjectName     'This needs to be declared at the start of the code with the other variables


    ' Now actually call to get the file name.
    varFileName = ahtCommonFileOpenSave( _
                    OpenFile:=True, _
                    InitialDir:=varDirectory, _
                    Filter:=strFilter, _
                    Flags:=lngFlags, _
                    DialogTitle:=varTitleForDialog)
    If Not IsNull(varFileName) Then
        varFileName = TrimNull(varFileName)
    End If
    GetGraphicFile = varFileName
       

    Select Case strParentFormName                      'This allows you to use this code for multiple forms
        Case "frmChild"                                          ' Name of your Form
            If IsNull(varFileName) Then                     'Check to see if a file was selected from the file picker
                Form_frmChild.ChildPhotoPath = ""       'if not the the field with the file path will be null ""
            Else
                Form_frmChild.ChildPhotoPath = GetGraphicFile      ' If there was a file picked from the filepicker then place the file path in this field
            End If
        Case "frmContact"
            Form_frmContact.ContactPhotoPath = GetGraphicFile
        Case "frmEmployee"
            Form_frmEmployee.EmployeePhotoPath = GetGraphicFile
    End Select
               
End Function


Give that a try and see if that solves it.

Cheers
M
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11731489
Of course you'll have to adapt the Case statement to your own application.

I'm assuming that you have a field in your table and on your form that you are storing the file path to correct?


Sorry I wasn't able to reply sooner today - work has been absolutely CRAZY!!

Let me know how it goes - I hope that bit helps...

Cheers
Michael
0
 

Author Comment

by:Ingx_Sub
ID: 11735551
This is the module that is used to do the actual importing of the text files:


'**************************************************************************
Public Function ImportText() As Boolean
    Dim szFile As String, szType As String
    Dim szSep As String
    Dim szCurrentDir As String, szDir As String
    Dim szMacro As String
    Dim sFile As String
   
    ' this better be where you want to be
    szCurrentDir = CurDir()
    MsgBox szCurrentDir
   
    'Application.DoCmd.OpenForm
   
    ' the path separator is always "\" in DOS/Windows
    szSep = "\"
   
    ' get the first file...note this call will fail if
    ' you are in a root...Les if you want to check the current directory
    ' to fix this bug be my guest
    szFile = Dir(szCurrentDir & szSep & "*.txt")
   
    'Set gfrmEDI = Form_frmSAEDI
    'gfrmEDI.SetFocus
   
    'DoCmd.TransferText acImportFixed, "USA Import Specification", "External Report", "Q:\SA\Text Import\09-21-00\Usa1201.txt"
    'Application.RunCommand (acCmdSaveAs)
   
    Do While szFile <> ""
   
    'concatenate the selected directory and the text file in question
    szDir = szCurrentDir & "\" & szFile
   
    If Len(szFile) > 11 Then
        szType = Left$(szFile, 4)
        szType = Right$(szType, 1)
        'concatenate the selected directory and the text file in question
        'szDir = szCurrentDir & "\" & szFile
       
        Select Case szType
            Case 5
                'MsgBox "UCCL0885"
                DoCmd.TransferText acImportFixed, "UCCL0885 Import Specification", "UCCL0885", szDir
            Case 6
                'MsgBox "UCCL0886"
                DoCmd.TransferText acImportFixed, "UCCL0886 Import Specification", "UCCL0886", szDir
            Case 7
                'MsgBox "UCCL0887"
                DoCmd.TransferText acImportFixed, "UCCL0887 Import Specification", "UCCL0887", szDir
            Case 8
                'MsgBox "UCCL0888"
                DoCmd.TransferText acImportFixed, "UCCLO888 Import Specification", "UCCL0888", szDir
            Case 9
                'MsgBox "UCCL0889"
                DoCmd.TransferText acImportFixed, "UCCLO889 Import Specification", "UCCL0889", szDir
            Case "u"
                'MsgBox "UCCL088u"
                DoCmd.TransferText acImportFixed, "UCCL088u Import Specification", "UCCL088u", szDir
            Case Else
                MsgBox "Unrecognized file type."
        End Select
    Else
        'MsgBox "UCCL088a"
        DoCmd.TransferText acImportFixed, "UCCL088 Import Specification", "UCCL088a", szDir
    End If
   
    ' get new file
    szFile = Dir()
   
    Loop
End Function

I changed that part like you said Michael...it's now this:

 ' Now actually call to get the file name.
    varFileName = ahtCommonFileOpenSave( _
                    OpenFile:=True, _
                    InitialDir:=varDirectory, _
                    Filter:=strFilter, _
                    Flags:=lngFlags, _
                    DialogTitle:=varTitleForDialog)
    If Not IsNull(varFileName) Then
        varFileName = TrimNull(varFileName)
    End If
    GetOpenFile = varFileName
   
     Select Case strParentFormName                      'This allows you to use this code for multiple forms
        Case "SelectDir"                                          ' Name of your Form
            If IsNull(varFileName) Then                     'Check to see if a file was selected from the file picker
                Form_SelectDir.szCurrentDir = ""       'if not the the field with the file path will be null ""
            Else
                Form_SelectDir.szCurrentDir = GetGraphicFile      ' If there was a file picked from the filepicker then place the file path in this field
           
    End Select

But, I'm not sure what I should change that Path part too.  I get a "Method or Data Member Not Found" error on the "szCurrentDir".
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11735790
Just on my way to work...
I'll have a look when I get there.

Cheers
M
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11737886
Hey there Ingx_Sub,

So it looks like this is not just a question on how to get the filepicker working.

Looking at the Code you pasted it looks to me like you want to Import some text.

It looks like you want the User to go and select the specific text file to Import.
This is where the filepicker issue comes in...

Is this correct?

M
0
 

Author Comment

by:Ingx_Sub
ID: 11737912
Yup, that is correct Mike.

This thing works just fine with Access 2002.  Basically the user uses the file picker to pick a directory, which is full of Text files, and then the module automatically grabs all the text files from that directory.
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11738103
As we now know - (unfortunately) the filepicker is not available in 2000 or earlier.
But you can do the same thing here with the maodular code that you have pasted in.

It doen't look like you are storing the file path itself in a table which is what I first assumed.  It looks like you are just using it as a variable to Import the text file from.
The only difference here is that the actual directory / file path is now saved as a variable called "GetOpenFile"
The name of the function "GetOpenFile" also becomes the variable that stores the file path.

So in your code...
 DoCmd.TransferText acImportFixed, "UCCL0885 Import Specification", "UCCL0885", szDir

>> "UCCL0885 Import Specification" - this is the Specification Name
>> "UCCL0885" - this is the Table Name
>> szDir - this is the string expression that's the full name, including the path, of the text file you want to import from

So that being said I would like to think that all you would need to do is change the "szDir" to "GetOpenFile" to reference the actual file path from the GetOpenFile Function.

Give that a try and see how it works.

Cheers
Michael
0
 

Author Comment

by:Ingx_Sub
ID: 11738125
ok, I'll give that a shot
0
 

Author Comment

by:Ingx_Sub
ID: 11738173
Do I still do the stuff you told me to do in this post :Date: 08/06/2004 07:01AM PDT
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11738253
No I would get rid of my case statement
0
 

Author Comment

by:Ingx_Sub
ID: 11738268
Ok, I did that.  Got the same thing as before:

The File Picker comes up, I chose the directory that I want the files to be picked from.  But then my verification message shows the wrong location, and the process tries to import the files from the wrong directory.
0
 
LVL 5

Accepted Solution

by:
Emanon_Consulting earned 500 total points
ID: 11738420
Have a look at the code that I added.
This is where I think you would add your DoCmd to transfer your text.  You can add it right in this module.

I hope that works...
Cheers
Michael


Option Compare Database

'***************** Code Start **************
'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 tagOPENFILENAME
    lStructSize As Long
    hwndOwner As Long
    hInstance As Long
    strFilter As String
    strCustomFilter As String
    nMaxCustFilter As Long
    nFilterIndex As Long
    strFile As String
    nMaxFile As Long
    strFileTitle As String
    nMaxFileTitle As Long
    strInitialDir As String
    strTitle As String
    Flags As Long
    nFileOffset As Integer
    nFileExtension As Integer
    strDefExt As String
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
End 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 Boolean
Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long

Global Const ahtOFN_READONLY = &H1
Global Const ahtOFN_OVERWRITEPROMPT = &H2
Global Const ahtOFN_HIDEREADONLY = &H4
Global Const ahtOFN_NOCHANGEDIR = &H8
Global Const ahtOFN_SHOWHELP = &H10
' You won't use these.
'Global Const ahtOFN_ENABLEHOOK = &H20
'Global Const ahtOFN_ENABLETEMPLATE = &H40
'Global Const ahtOFN_ENABLETEMPLATEHANDLE = &H80
Global Const ahtOFN_NOVALIDATE = &H100
Global Const ahtOFN_ALLOWMULTISELECT = &H200
Global Const ahtOFN_EXTENSIONDIFFERENT = &H400
Global Const ahtOFN_PATHMUSTEXIST = &H800
Global Const ahtOFN_FILEMUSTEXIST = &H1000
Global Const ahtOFN_CREATEPROMPT = &H2000
Global Const ahtOFN_SHAREAWARE = &H4000
Global Const ahtOFN_NOREADONLYRETURN = &H8000
Global Const ahtOFN_NOTESTFILECREATE = &H10000
Global Const ahtOFN_NONETWORKBUTTON = &H20000
Global Const ahtOFN_NOLONGNAMES = &H40000
' New for Windows 95
Global Const ahtOFN_EXPLORER = &H80000
Global Const ahtOFN_NODEREFERENCELINKS = &H100000
Global Const ahtOFN_LONGNAMES = &H200000

Function TestIt()
    Dim strFilter As String
    Dim lngFlags As Long
    strFilter = 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 String
Dim lngFlags As Long
Dim 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_NOCHANGEDIR
    If IsMissing(varDirectory) Then
        varDirectory = ""
    End If
    If IsMissing(varTitleForDialog) Then
        varTitleForDialog = ""
    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, "Text Files (*.txt)", "*.TXT")
   
    ' Now actually call to get the file name.
    varFileName = ahtCommonFileOpenSave( _
                    OpenFile:=True, _
                    InitialDir:=varDirectory, _
                    Filter:=strFilter, _
                    Flags:=lngFlags, _
                    DialogTitle:=varTitleForDialog)
    If Not IsNull(varFileName) Then
        varFileName = TrimNull(varFileName)
    End If
    GetOpenFile = varFileName

'**********ADDED CODE************

    'Not Sure if you actually need the If statement - it may work with just the DoCmd line
    'I'm only using the If stmnt to make sure there was a file path selected and the variable is Not Null
    'If the variable was Null then the DoCmd would produce Errors - not nice...

    If Not IsNull(varFileName) Then  
        DoCmd.TransferText acImportFixed, "UCCL0885 Import Specification", "UCCL0885", GetOpenFile
    End If

'************END*****************

End 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 filename
Dim OFN As tagOPENFILENAME
Dim strFileName As String
Dim strFileTitle As String
Dim fResult As Boolean
    ' Give the dialog a caption title.
    If IsMissing(InitialDir) Then InitialDir = CurDir
    If IsMissing(Filter) Then Filter = ""
    If IsMissing(FilterIndex) Then FilterIndex = 1
    If 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.hWndAccessApp
    If 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 function
    With 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 = 255
    End 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 Then
        fResult = aht_apiGetOpenFileName(OFN)
    Else
        fResult = 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.Flags
        ahtCommonFileOpenSave = TrimNull(OFN.strFile)
    Else
        ahtCommonFileOpenSave = vbNullString
    End If
End 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 & vbNullChar
End Function

Private Function TrimNull(ByVal strItem As String) As String
Dim intPos As Integer
    intPos = InStr(strItem, vbNullChar)
    If intPos > 0 Then
        TrimNull = Left(strItem, intPos - 1)
    Else
        TrimNull = strItem
    End If
End Function
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11738435
If it still doesn't work - how do you feel about email a scaled down version of your app?
Then I could take a look and see if I can sort it out for you...

Let me know and if you want I'll give you my email addy.

Cheers
Michael
0
 

Author Comment

by:Ingx_Sub
ID: 11738561
It still showed me the wrong file location.  Sure, I can e-mail you this thing, that would be great!
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11738722
my email addy is

emanon at shaw dot ca

of course the at =@
and the dot =.

You will need to zip it up before you send it otherwise it will be removed by my email filter.

Cheers
M
0
 

Author Comment

by:Ingx_Sub
ID: 11738930
I sent it...were you able to open it?
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11739203
Yep - got it and I am having a look.

I am just trying to figure out what it is you are trying to do.

It looks like you are running a delete query to clear data from a table.
Then you are opening the file picker to select a text file.
Then you want to docmd.transfertext of the selected text file.

Is this right?

I'm going to add a form with a working file picker and get that part working first.
Then we can go from there.

M
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11739551
So no problems with the code.
I can get it to pick a file no problemo.  I have it displaying in an unbound text box right now.

I thought I would have a look and see if I could work in the rest of your code for you as well.
It might be helpful to have a sample of one of you text files that you are importing.
That is of course if you are OK with the extra help...

Cheers
Michael
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11740492
I just sent it back to you.
The filepicker is working fine.

I can have a look at the other stuff you are trying to do and see if I can get it all to give if you like.

Cheers
M
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11756012
Hi there Ingx_Sub

Just thought I would check in to see how it's going?
Did you got my email?

Cheers
Michael
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11824261
Hi Ingx_Sub,

Thanks for the points and thanks for the grade!

Happy databasing!

Cheers
Michael
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now