message box text

L

LGarcia

Hi all,
I have macro that ends with a statement opening a message box. The message
reads: "Analysis is complete." I'd like to add the name of the database to
this message so
it will read "Analyis of TestData.MDB is complete." Is there a way to do
this through the macro design window?

TIA
LGarcia
 
S

Steve Schapel

LGarcia,

I don't get it. Why can't you just directly put "Analyis of
TestData.MDB is complete." as the Message argument for the MsgBox
action?

- Steve Schapel, Microsoft Access MVP
 
L

LGarcia

Sorry that I didn't explain this better.
I'd like the message to say "The Analysis of [Current Database] is complete"
having the actual name of the current database appear between "of" and 'is".
The app I'm working with ( a DB containing forms and queries) can be linked
to different databases that are identical in structure( Dbs containing
data).
Currently I'm linked to TestData.MDB. So I'd like the message to read "The
Analysis of TestData.MDB is complete."
If I change the link to SampleOne.MDB I'd like the message to read 'The
Analysis of SampleOne.MDB is complete."
Hope I've explained myself better.
Thanks for your replies.
LGarcia
(Using Access XP)
 
S

Steve Schapel

LGarcia,

Aha! Now I'm with you.

As far as I know, you can't retrieve the name of a linked data file
using a macro. I think you would need a VBA routine to do this. For
example...

Dim bePath As String
Dim beDb As String
bePath = CurrentDB.TableDefs("OneOfYourLinkedTables").Connect
beDb = Right(bePath, Len(bePath) - InstrRev(bePath,"\"))
MsgBox "The Analysis of " & beDb & " is complete"

- Steve Schapel, Microsoft Access MVP
 
L

LGarcia

A little info goes a long way......
It worked!!!
Thanks for your help

Steve Schapel said:
LGarcia,

Aha! Now I'm with you.

As far as I know, you can't retrieve the name of a linked data file
using a macro. I think you would need a VBA routine to do this. For
example...

Dim bePath As String
Dim beDb As String
bePath = CurrentDB.TableDefs("OneOfYourLinkedTables").Connect
beDb = Right(bePath, Len(bePath) - InstrRev(bePath,"\"))
MsgBox "The Analysis of " & beDb & " is complete"

- Steve Schapel, Microsoft Access MVP


Sorry that I didn't explain this better.
I'd like the message to say "The Analysis of [Current Database] is complete"
having the actual name of the current database appear between "of" and 'is".
The app I'm working with ( a DB containing forms and queries) can be linked
to different databases that are identical in structure( Dbs containing
data).
Currently I'm linked to TestData.MDB. So I'd like the message to read "The
Analysis of TestData.MDB is complete."
If I change the link to SampleOne.MDB I'd like the message to read 'The
Analysis of SampleOne.MDB is complete."
Hope I've explained myself better.
Thanks for your replies.
LGarcia
(Using Access XP)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top