Nav Pane opens when importing tables in a MDE (1 Viewer)

kfschaefer

Registered User.
Local time
Today, 15:34
Joined
Oct 10, 2008
Messages
58
I am generating a MDE file type of my development versions. I have the Nav window turned off, however, I do have a few linked tables that are refresh on demand via code from the user. the Nav window becomes accessible when these linked tables are being refreshed. How do I prevent this?

thanks,
Karen

Here is my current code that refreshes the linked table's datasource. It is here where the Nav Window opens. Someone from another forum recommended using a TableDef instead of TransferDatabase I am currently using.

Code:
Public Function RecreateTable(ByVal stable As String) As Boolean

   On Error GoTo RecreateTable_Error

    RecreateTable = False
        If stable = "TA_FTIR" Or stable = "TA_MeasFltr" Then
            If IsTableExist(stable) = False Then
                GoTo ResumeNext
            Else
                DoCmd.DeleteObject acTable, stable
            End If
            If Err.Number <> 0 Then
                If Err.Number <> 7874 Then
                      MsgBox "Error deleting old table" & vbCrLf & Err.Description
                      Exit Function
                 End If
            End If
            Err.Clear
ResumeNext:
            DoCmd.TransferDatabase acLink, "Microsoft Access", gAPFilePath, acTable, stable, stable
            If Err.Number <> 0 Then
                MsgBox Err.Description
            Else
                RecreateTable = True
            End If
'        ElseIf stable = "tblProjectTask" Then
'            DoCmd.TransferDatabase acLink, "Microsoft Access", gAPFilePath, acTable, stable, stable
'            RecreateTable = True
'            Exit Function
        End If
   On Error GoTo 0
   Exit Function
RecreateTable_Error:

    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure RecreateTable of Module Functions"

End Function
 

Attachments

  • NavPane.png
    NavPane.png
    33 KB · Views: 92

Mr. B

"Doctor Access"
Local time
Today, 17:34
Joined
May 20, 2009
Messages
1,932
If your tables are truly "linked" tables then there should be no reason for deleting the object (table) and then re-linking the same table.

There are always special circumstances that require unusual actions. And, IMO, what you are doing is an unusual thing to do. Is there some specific reason that you are forced to do this?

If not, I would just eliminate this process all together.
 

kfschaefer

Registered User.
Local time
Today, 15:34
Joined
Oct 10, 2008
Messages
58
Yes, the table need will come from different mdb every time. Depending on the user Selection of a dropdown.

ie. User1 selects ID 12345 from dropdown - mdb location may be c:\Access\12345.mdb
User2 selects ID 34564 from dropdown - mdb location may be c:\Access\34564 .mdb
User3 selects ID 45645 from dropdown - mdb location may be c:\Access\45645 .mdb

Hence the need to drop and relink the correct datasource each time.

thanks,

karen
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:34
Joined
Feb 19, 2002
Messages
43,331
I had a similar problem in an .accde and it seems that once the nav pain(sic) opens there is no getting rid of it again. At least none of the code solutions I found would actually hide it again. The one thing that did work was renaming the extension to .accdr which tells Access to open the file as if it were the runtime engine. Using this method, the nav pane no longer opens when I import files.

If converting to the .accdr format is not an option, try creating a shortcut to run the app and use the /Runtime switch which should have the same effect.
 

kfschaefer

Registered User.
Local time
Today, 15:34
Joined
Oct 10, 2008
Messages
58
Thanks I have searched High and low on the web for this solution. That seems to have done the trick. You should submit this to MSDN for a work around with this bug.

Karen
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:34
Joined
Feb 19, 2002
Messages
43,331
I hate bugs like this and I think I found another today. I was importing some data from an external source and their column names were all caps. Some of the names in my table were identical to the import except they were proper case. The append query not only appended the data IT CHANGED MY COLUMN NAMES!!!!! So whenever the name was the same Lot/LOT, Map/MAP, Style/STYLE, etc. My column names are now caps!
 

Users who are viewing this thread

Top Bottom