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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to confirm fe linked to be in current directory on startup 2

Status
Not open for further replies.

SiberBob

Programmer
Aug 28, 2002
107
0
0
US
I have a MS 2000 FE and BE that reside in the same directory. I want to set it up so when you open the FE it removes the link to the BE (regardless of where it is) and links to the BE that exists in the current directory of the FE.

FE = "EquipRecord.mdb"
BE = "EquipRecordData.mdb"
Table to be linked = "EquipmentRecords"

I tried this code on the opening action of a form in the FE that is not bound to any tables:

Code:
    DoCmd.DeleteObject acTable, "EquipmentRecords"
    DoCmd.TransferDatabase acLink, "Microsoft Access", CurrentProject.FullName, acTable, "EquipmentRecords", "EquipmentRecords"

I get the following error:

Microsoft Visual Basic
Run-time Error '3078':
The Microsoft Jet database engine can not find the input table or query 'EquipmentRecords'. Make sure it exists and that its name is spelled correctly.
[/color blue]

My objective is to make the front end and back end work in any directory they are stored in as long as they are both in the same directory. This is not a networked app that needs to be accessed by multiple individuals, but we may end up with multiple individuals each using their own FE / BE and I don't want any restrictions on where the place it on their system...

Thoughts / input / suggestions welcome...

Thanks,
 
I think the problem here is CurrentProject.FullName

Try:

[tt]DoCmd.TransferDatabase acLink, "Microsoft Access", CurrentProject.Path & "\EquipRecordData.mdb"
, acTable, "EquipmentRecords", "EquipmentRecords"[/tt]

Have a look in these fora for Object Exists, as you should test if the table exists before trying to delete it or you will get an error.
 
You may use this:
CurrentProject.Path & "\EquipRecordData.mdb"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You guys Rock!

I had tried a variation of that earlier with
CurrentProject.path & "\" & CurrentProject.name
but apparently that doesn't work or I buggered up something in my syntax because the suggestion you both gave works flawlessly!

Thanks - and Happy Thanksgiving!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top