Solved

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

Posted on 2014-09-09
6
204 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 57
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 57
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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 57

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

752 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