Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Filename on Form

Status
Not open for further replies.

laman

Technical User
Jan 24, 2002
44
0
0
US
I would like to have the current database filename show up in a textbox on a form. Any ideas?

Thanks.
 
Dim MyDB As Database
Dim Temp As String


Set MyDB = CurrentDb()
Temp = MyDB.Name

This will give you the full path and the database name (this is from Access 97 dao)

To get the mdb name


L = 1
lSlash = 1
Do Until L = 0
L = InStr(L, Temp, "\")
If L <> 0 Then
lSlash = L
L = L + 1
End If
Loop

print Left$(Temp, lSlash) gives the path
D:\utils
print right$(temp,len(temp)-lslash) gives the mdb
Time and Billing.mdb
Peter Meachem
peter@accuflight.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top