Determine File Location

Hi,

Is it possible (in VBA) to check and see where an Access file is being
opened/accessed from?

For example:
If mdb/mde file attempting to be opened resides in C:\db then
'do something
else
'do something else
end if

Thanks,
alex
0
alex
1/13/2010 1:48:29 PM
access 16762 articles. 2 followers. Follow

2 Replies
658 Views

Similar Articles

[PageSpeed] 53

"alex" <sql_aid@yahoo.com> wrote in message 
news:4f320ceb-c85f-41f7-b852-9598cc9cb2a6@m26g2000yqb.googlegroups.com...
> Hi,
>
> Is it possible (in VBA) to check and see where an Access file is being
> opened/accessed from?
>
> For example:
> If mdb/mde file attempting to be opened resides in C:\db then
> 'do something
> else
> 'do something else
> end if
>
> Thanks,
> alex


CurrentProject.Path returns the folder path where the current database 
resides.

CurrentProject.Name returns the name of the current database file.

CurrentProject.FullName returns the folder path and name of the current 
database file.

CurrentDb.Name also returns the folder path and name of the current database 
file, but doesn't work in an ADP (Access Data Project).

-- 
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

0
Dirk
1/13/2010 1:59:42 PM
On Jan 13, 8:59=A0am, "Dirk Goldgar"
<d...@NOdataSPAMgnostics.com.invalid> wrote:
> "alex" <sql_...@yahoo.com> wrote in message
>
> news:4f320ceb-c85f-41f7-b852-9598cc9cb2a6@m26g2000yqb.googlegroups.com...
>
> > Hi,
>
> > Is it possible (in VBA) to check and see where an Access file is being
> > opened/accessed from?
>
> > For example:
> > If mdb/mde file attempting to be opened resides in C:\db then
> > 'do something
> > else
> > 'do something else
> > end if
>
> > Thanks,
> > alex
>
> CurrentProject.Path returns the folder path where the current database
> resides.
>
> CurrentProject.Name returns the name of the current database file.
>
> CurrentProject.FullName returns the folder path and name of the current
> database file.
>
> CurrentDb.Name also returns the folder path and name of the current datab=
ase
> file, but doesn't work in an ADP (Access Data Project).
>
> --
> Dirk Goldgar, MS Access MVP
> Access tips:www.datagnostics.com/tips.html
>
> (please reply to the newsgroup)

Worked perfectly Dirk; many thanks!
alex
0
alex
1/13/2010 5:51:32 PM
Reply:

Similar Artilces:

determine mail flow problem!!!!!!!!
Help! :-( Our mailflow from 2 backend 2003 exchange servers keeps queuing up in the outbound queue (which is set to always run delivery). Messages stay in there from 10 to 120 minutes before being sent to our gateway MTA and then sent off site (to hotmail.com for example). However when I telnet from a backend server to the gateway over port 25 and send a test message it goes right away. I can't for the life of me figure out why. One example when viewed in message tracking history says: 10:16am - smtp: store driver, message submitted from store 10:16am - smtp: message submitted to ...

Opening Files*
When I open an Excel file only the blank Excel screen comes up. Then I have to go to open and find it etc. How do I set up so files automatically open in the program they were saved on? Thank If you save all your excel files in a particular folder you set the default through Tools > Options then under the general tab. Type the path to the folder that you wish and when you select open excel will open tht folder. Is this what you meant? regards Murray >-----Original Message----- >When I open an Excel file only the blank Excel screen comes up. Then I have to go to open and find i...

how do I create one publisher .doc file from 12 files w/pages
how do I create one publisher doc from variety of multipage publisher docs. Is there an easy way or must I copy and paste each page from each doc into a new doc. HELP! Looking forward to hearing the answer. I dont know what to look for in the help area, merge? catalogue? -- jane I being a Publisher 2000 user, have only two solutions; in Publisher, copy/paste from one file to the other. or Create a PDF file out of the first file and append PDF files of the other publisher files. Standby for other better methods. Best if you mentioned your version of Publisher. -- Don Vancouver, ...

Publishing files to a web server
I am writing an ASP.NET web service to enable publishing of content from a SQL server database to an internal web site. I am new to the .NET world and am seeking advice on the most efficient way to perform this using ASP.NET? In a previous language (Delphi), I achieved this by creating a file on the local disk and then used an FTP component to transfer the file via FTP to the web server. I have looked at the WebClient UploadFile method to upload the file from the local drive to a virtual directory on the web server (but get the message "Method" not allowed). I have also i...

How can I link a word file to an object in Visio prof.
I want to be able to link a word document to a shape in Visio. So that when I click or hover on a shape I have the option of having a link to the document, or to have the text itself become visible the way that a "screenTip" appears?...is this possible? Sure, you can hyperlink to it. If you have implemented bookmarks in the document you can even go to them as well. al "CMASS" <CMASS@discussions.microsoft.com> wrote in message news:25C80F45-2558-47D2-B9BD-C1A956D99533@microsoft.com... >I want to be able to link a word document to a shape in Visio. So that whe...

Menu Options on File
I have Outlook 2000 working in Win2k with all the service paks installed. On my File menu I have a Backup menu option that allows me to back up my .pst files at pre- defined interavals. I have Outlook installed on WinXP Home and it does not give me the backup option. Is there something that can be set in Outlook on the XP system to give me that menu item? ...

Determine columns used
I have 100+ spreadsheets which i have to edit into a certain format. The spreadsheets currently have 100 columns (from 1-100). From there i have to reduce the number of columns set to 8 columns. E.g: 1 2 3 4 5 6 7 8 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (from column 9 onwards, it goes to the 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 next rows' column 1) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 How do i do that without altering the order of the value of the cell? Let me make sure we understand the question. You have ...

URGENT! How to locate a file?
I need for a user to place my exe that they have downloaded onto their desktop. I then want them to execute it and have the program search their computer for my database and then my program will update that database to add new fields. How do I do a search for my database on their hard drive and then return the drive and directory location? Thanks for your help. That depends upon the database type. If you are using SQL Server (or MSDE) for example, you need to know the server name. If it's on the same unit, you may use '.' - which is the local server, and the database and...

2 accounts & 2 PST files
Hello everyone I'm using Outlook 2003 and I have 2 accounts for which I would like Outlook to be able to delivers new e-mails in each respective data file I mean for account "A" new mail will be delivered in A.pst and for account "B" in B.pst PS: I would prefers to use only one profile and not two Thanks & Regards You'll need two profiles if you want this setup. Delivery location is set per profile, not per mail account. NATT wrote: > Hello everyone, > > I'm using Outlook 2003 and I have 2 accounts for which I would like > Outlook to be abl...

how to turn a file into a j peg
if i have done a design in publisher for a flyer but the printers need to file to be converted into a j-peg. any 1 know how this is done ? Which version of Publisher? -- JoAnn Paules MVP Microsoft [Publisher] "dan reddish" <dan reddish@discussions.microsoft.com> wrote in message news:07BBD2D8-C5A4-4481-9518-36188E0DB0D3@microsoft.com... > if i have done a design in publisher for a flyer but the printers need to > file to be converted into a j-peg. any 1 know how this is done ? I've never had a print house request a file as a jpeg...wonder why = they'd...

Outlook Express and Signature files
I am using Outlook Express v.6. I want to add an HTML signature file to outgoing email. I have created one using Word and placed a piece of clipart in the file. The file size is 6.76kb. When I open Outlook Express it tells me the signature file size is too large. It has been truncated, please make the file smaller. These are my questions. What is the maximum size of the HTML file that can be added to Outlook Express? Are you even able to add graphics to the signature file that is being used by Outlook Express? What is the best way to add a small graphic to each outgoing mess...

File Download
I'm installing CRM client on an XP Pro SP3 laptop with Outlook 2007. When I launch Outlook and go to CRM, I get a file download box that is asking me to save a file named Blank.aspx. It is coming from my server. This isn't happening on any other PC. If I save it, it just saves a blank text document to the desktop. This file download pops up on every CRM screen. Is there a way to turn this file download off? Thanks, John Hi John, Are you using IE6 and do you have KB953838 - if so then the workaround would be as follows: 1. Save the “blank.aspx” file to the desktop 2...

How to put file name and directory at bottom of every worksheet
Pls help me find out how to How to put file name and directory at bottom of every worksheet? pdk1974@hotmail.com That needs a macro. See http://www.cpearson.com/excel/headfoot.htm on how. -- HTH. Best wishes Harald Followup to newsgroup only please "Pedro" <pdk1974@hotmail.com> skrev i melding news:050c01c39167$efec5dd0$a001280a@phx.gbl... > > Pls help me find out how to > > How to put file name and directory at bottom of every > worksheet? > > pdk1974@hotmail.com Pedro, if you want to put it in a cell and not in the footer this will do it, the w...

AP Signature file
We have had a change in management & need to change the signature on our checks. This was origninally set up by our reseller, but we would like to make that change ourselves. Anyone point to some documentation on installing / testing a signature file? Thanks Merle, Are your checks printed using the standard GP check form or are you using a 3rd party app like Mekorma? If standard GP, then you'll need to modify the check using Report Writer and replace the current image file. If Mekorma or another 3rd party app, you will need to use their form customization tools. Hope this he...

Dynamically determining when a month ends
Hello all, Ok, I have a simple excel spreadsheet, where I keep track of my spending on one tab, my income in another and my summary in a thrid. My problem happens when I try to dynamically calc. avg's for months in the summary page. For instance, if I want to see how much money I spent on average per month, or even per day, I draw from the data entered into the spending page. Now, the spending page is set up with the following columns: Date:: Description:: Amount The problem with this is that I can't predefine a max row # for each month, since I might have 80 entries in spending...

how to determine the size of the sheet
Hi I had a collegue who told me once a way to dtermine the number of the rows in a sheet of the workbook I am working at. It is known that when you open a new workbook each sheet has maybe 65365 or something like that rows. MY QUESTION IS: HOW TO MAKE THE SHEET 1000 ROWS OR WHATEVER NUMBERS OF ROWS I ONLY NEED? Thanks in Advance, Ahmed Hi Ahmed The number of rows and columns are fixed. Your workaround would be to hide the ones you consider unneeded. HTH. Best wishes Harald "Ahmed SHEBL" <ahmad.shebl@hotmail.com> skrev i melding news:%231uFO3IcHHA.4720@TK2MSFTNGP0...

Transfering a Money file to a laptop
I have recently converted from Quicken to Money 2005. I have Money istalled on my home PC and I wish to be able to transfer my Money fioe to my laptop to have it available when away from home. I have installed Money on the laptop and backed up my file to a USB device but when I try to restore the file to the laptop I am unable to do so getting a message saying "....the file can't be located, or it is read only, or I don't have permission, or it is write-protected", none of which are correct. If I copy the file directlt to my laptop and try to open it I get the same mes...

OST file issue
Friends, I got a very urgent issue. So any help is appreciated! If the old Offline storage file (OST) was renamed and new one created, can I re-attach the old OST file to outlook renaming it back to outlook.ost? User has made a lot of changes in offline mode and needs to those changes to be synchronized. Will I be able to rename the new OST file from outlook.ost to something else and put the old OST in its place, then load outlook in offline mode and then synchronize it? I'd really appreciate your help! thanks, FARHAD. ...

How to extend an if statement between 2 different Files
I have 2 files with model numbers and one file has UPC numbers tied to certain model numbers is there a way to write an if statement to extend between boh and automatically paste the UPC number tied to the model number in the other sspreadsheet file? --- Message posted from http://www.ExcelForum.com/ Nick, You can use VLOOKUP across multiple workbooks. This would reside in Book1 =VLOOKUP(1,[Book2]Sheet1!$A$1:$B$3,2,FALSE) where 1 is the key values in A1:B3, B being the UPC in your case. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from...

Publisher cuts off text from word file that I am pasting into tex.
What does "Type your message here" mean to you? -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading this message, view the disclaimer: http://mvps.org/the_nerd/disclaim.htm Let me guess the question... You paste Word text into a Publisher text box and it doesn't fit. -- Mary Sauer MS MVP http://office.microsoft.com/ http://www.msauer.mvps.org/ news://msnews.microsoft.com "DeborahKB" <DeborahKB@discussions.microsoft.com> wrote in message news:F29CD723-545B-4A7C-8ACA-DD5092DCE101@microsoft.com... > Ooooooooh, Mary...

Exporting to a text file
How to export an Access query to a text file without the column heading? The query consists of single column and is used to import to an accounting system. Thanks. Cannot be done with the built-in TransferText action / method. You'd need to open a text file via VBA code and write the query's records (one at a time) into that file. If interested, post back and I'll provide some sample code. -- Ken Snell <MS ACCESS MVP> "Paul" <paul_mak@shaw.ca> wrote in message news:O$MxJCPlHHA.1244@TK2MSFTNGP04.phx.gbl... > How to export an Access quer...

Excel files reporting read only
I have an issue where a user I provide support for is being told that a file that has not been opened for a couple of months is reporting as being locked for editing by the last user to save the file (in some cases these users no longer exist on our network). When you check the open files on the server, these files are not showing as open. If teh user clicks to close, and then immediatley re-opens the file it opens as normal. There are no temporary files in the folder that the files are located in and I have cleared the temp folders on the client and on the server. The user has full control...

Trusted locations for 2007 Access
I am going to purchase a new PC and order Office Professional 2007 with it. I now use Office 2003 and have many data bases. It is my understanding that I will have to locate my data bases in a "Trusted Location" to use them with Access 2007. All my data bases are now located in "My Documents" along with a lot of other files. My first question is will I have to move my data bases individually or is there some way I can move or make them all "Trusted" at one time? Not being familiar with "Trusted FIles", my second question is there some ...

PLEASE HELP! How to extract information in inbox/sentbox into a text file #2
Can any one tell me how to extract the information of new mails in m inbox/sentbox, including the sender name, message subject and messag time, into a text file ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com ...

A code to import other xls data into one xls file
Hi there. Can anyone help me in creating a VB code in excel Module that imports data like file name;direct cost; and year from several xls spreadsheets [reports_1, reports_2, ...] (from different sheets and cells) into one spreadsheet [summary] into the following columns accordingly: (column 1 [file name]: file name; column 2 [direct cost]: dollar amounts, column 3 [year]: year)? i already have the code that pulls file names from the folder directory and pastes the data into column 1 [file name]. may be it will be easier to have the code refer to that column 1. Please note that t...