Solved

How display name of back-end file on main form of front end file

Posted on 2014-09-09
6
205 Views
Last Modified: 2014-09-09
I want to display the name of back-end file on main form of front end file for a split database.    Can this be done?

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 58
ID: 40312370
Yes.

  CurrentDB().TableDefs("<table name>").Connect

Will give you the connection string for a table.  Pick any table that is in that BE, get the connect string, then look for DATABASE=

What's after that is the path to the BE database.

Jim.
0
 

Author Comment

by:SteveL13
ID: 40312454
Thanks.  I have the file path and name displaying on the Main Form of the front-end.  But if I manually re-link the tables to a different B/E file the name doesn't refresh itself until I close and re-open the database.

??
0
 
LVL 58
ID: 40312518
How are you manually re-linking?

 Depending on how, it's either that you'll need to refresh the tableDefs collection or the control that is displaying the value.

  But you certainly don't need to close and re-open the app.

Jim.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:SteveL13
ID: 40312602
I have this code in the oncurrent event of the form.

Dim MyConnectString As String
Dim MyFullPath As String

    MyConnectString = CurrentDb().TableDefs("Member Table").Connect
    MyFullPath = Right(MyConnectString, Len(MyConnectString) - Len("Database;"))

    Me.txtCurrentBEfile = "Current B/E File: " & MyFullPath

Open in new window

But when I:

External Data > Linked Table Manager > to link to a different backend, the field, Me.txtCurrentBEfile , is not "refreshed" and still shows the last B/E file
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 40312647
Well in that case, there is no way it's going to.  There's no hooks in the linked table manager that you can use to trigger a requery/refresh of data or trigger code.

 To do what you want, you'd have to do the relinking on your own and then push the data into the control again or do something that causes the OnCurrent event to fire again (like move off/on the record).

 Another method would be to remove the linked table manager from the ribbon, create a button (on the ribbon or in the form), and then do:

    RunCommand acCmdLinkedTableManager
    MyConnectString = CurrentDb().TableDefs("Member Table").Connect
    MyFullPath = Right(MyConnectString, Len(MyConnectString) - Len("Database;"))

    Me.txtCurrentBEfile = "Current B/E File: " & MyFullPath

Last, another method would be to use a form timer and fire it every xx seconds.  In that event, push the data into the control.

The way you have it now though, it will refresh as soon as you move off the record.

Jim.
0
 

Author Closing Comment

by:SteveL13
ID: 40312787
Thanks Jim!  I used the form timer method.  Works perfectly.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

635 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