Solved

Finding the desktop folder of the current User in Access 2007 VBA

Posted on 2010-11-23
3
435 Views
Last Modified: 2012-05-10
Like it says in the title, I need to find a file on the desktop of the User that has my app open. I have code to look for file in a folder already - but where do I make it look at that desktop folder for the current User? Is there an easy way?

many thanks.
0
Comment
Question by:Peborgh
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 400 total points
ID: 34195968
Environ("USERPROFILE") & "\Desktop" will get you there.
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 100 total points
ID: 34196338
Or you can try the API call available via the code located at: http://www.mvps.org/access/api/api0054.htm

This API call gives you a variety of parameters for locating various folders on the users computer.
0
 

Author Comment

by:Peborgh
ID: 34196833
LSM...: it works! (why am I not surprised...)

Fyed: very comprehensive and will remain in my list of "useful things to know about" but for the moment, I will use LSM...'s simpler solution.

peter
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

912 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now