Check if folder path exists

Hi there,

I have a browse button to search for a folder path - working great!

1.
However, the user can obviously enter a path manually into a text field 
(preceding the browse button). How can I check whether this path actaully 
exists before saving the record?

2.
While I am on that subject, is there a way to prevent a user from tabbing 
past the last field of an input form? I don't want the input form to display 
a new record after a user has pressed tab on the last field... 

Thank you in advance,
-- 
The Psyber Fox
http://www.psyberconsulting.co.za
0
Utf
5/13/2010 1:01:01 PM
access 16762 articles. 3 followers. Follow

4 Replies
1936 Views

Similar Articles

[PageSpeed] 2

Assuming the folder path is in variable strPath, Len(Dir(strPath, 
vbDirectory)) will return 0 if the folder does not exist (and non-zero if it 
does)

-- 
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"PsyberFox" <PsyberFox@discussions.microsoft.com> wrote in message 
news:49222D17-172A-44C0-9197-34E196EE60D7@microsoft.com...
> Hi there,
>
> I have a browse button to search for a folder path - working great!
>
> 1.
> However, the user can obviously enter a path manually into a text field
> (preceding the browse button). How can I check whether this path actaully
> exists before saving the record?
>
> 2.
> While I am on that subject, is there a way to prevent a user from tabbing
> past the last field of an input form? I don't want the input form to 
> display
> a new record after a user has pressed tab on the last field...
>
> Thank you in advance,
> -- 
> The Psyber Fox
> http://www.psyberconsulting.co.za 


0
Douglas
5/13/2010 1:17:41 PM
1.
 Dim strFile As String
    strFile = "C:\Temp\123.txt"

    If Dir(strFile) = "" Then

        MsgBox strFile & " doesn't exist"

    Else

        MsgBox strFile & " exists"

    End If

2.
Use form's BeforeUpdate event. There you can perform data validation and
not save or save and close the form as necessary.

-- 
Len
______________________________________________________
remove nothing for valid email address.
"PsyberFox" <PsyberFox@discussions.microsoft.com> wrote in message 
news:49222D17-172A-44C0-9197-34E196EE60D7@microsoft.com...
| Hi there,
|
| I have a browse button to search for a folder path - working great!
|
| 1.
| However, the user can obviously enter a path manually into a text field
| (preceding the browse button). How can I check whether this path 
actaully
| exists before saving the record?
|
| 2.
| While I am on that subject, is there a way to prevent a user from 
tabbing
| past the last field of an input form? I don't want the input form to 
display
| a new record after a user has pressed tab on the last field...
|
| Thank you in advance,
| -- 
| The Psyber Fox
| http://www.psyberconsulting.co.za



-- 
Len
______________________________________________________
remove nothing for valid email address. 


0
Len
5/13/2010 1:19:55 PM
1. See http://www.devhut.net/index.php?lang=en&pid=0000000027#FolderExist

2. You need to limit the number of records, see 
http://www.devhut.net/index.php?lang=en&pid=0000000004#LimitRec  and set your 
limit to 1.
-- 
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"PsyberFox" wrote:

> Hi there,
> 
> I have a browse button to search for a folder path - working great!
> 
> 1.
> However, the user can obviously enter a path manually into a text field 
> (preceding the browse button). How can I check whether this path actaully 
> exists before saving the record?
> 
> 2.
> While I am on that subject, is there a way to prevent a user from tabbing 
> past the last field of an input form? I don't want the input form to display 
> a new record after a user has pressed tab on the last field... 
> 
> Thank you in advance,
> -- 
> The Psyber Fox
> http://www.psyberconsulting.co.za
0
Utf
5/13/2010 1:47:01 PM
To stay on the same record
   Set the form's Cycle property to Current Record.

The use could still move to a new form using the mouse or other methods but 
TABBING through the controls will keep you on the same record.


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

PsyberFox wrote:
> Hi there,
> 
> I have a browse button to search for a folder path - working great!
> 
> 1.
> However, the user can obviously enter a path manually into a text field 
> (preceding the browse button). How can I check whether this path actaully 
> exists before saving the record?
> 
> 2.
> While I am on that subject, is there a way to prevent a user from tabbing 
> past the last field of an input form? I don't want the input form to display 
> a new record after a user has pressed tab on the last field... 
> 
> Thank you in advance,
0
John
5/18/2010 1:09:37 PM
Reply:

Similar Artilces:

Folder security in Windows CE 6.0
Does any one let me know whether folder security (user should not be able to delete the folder or folder can be password protected) can be implemented in windows CE 6.0? Can anyone please let me know how i can implement it? Thanks Vikram G Submitted via EggHeadCafe - Software Developer Portal of Choice BOOK REVIEW: C# In Depth by Jon Skeet (Manning) http://www.eggheadcafe.com/tutorials/aspnet/42abae52-2297-42bb-b020-2b02f9f436a9/book-review-c-in-depth.aspx On 1/12/2010 11:00 AM, Vikram G wrote: > Does any one let me know whether folder security (user should n...

Message From Field in Folder
When viewing the list of my new messages, is there a way to see the email address of the sender instead of the alias before I open it? In the From column I see "John". When I open the email I see "John <john@johnsemail.com>". I want to see the "john@johnsemail.com" before I open it so I can tell the difference between emails from "Microsoft Support <yourfu@edifyouopenedthis.com>" and "Microsoft Support <someguywhosreally@microsoft.com>" I am currently using outlook 2002 and 2003 alternately based on my mood. Mike If you ...

Moving Emails to a Public Folder
Hi, I have Exchange 2003 automatically forwarding anything sent to several email addresses to one public folder. The problem is that these items appear in the public folder with the "Posted To:" field, but not the "To:" field, so we don't know which email address it was sent to (without looking in the headers). When you reply, the original email in the body still only references the public folder "Posted To:" field, and not the email address it was originally sent to. Is there a way to change this behavior so the "To:" field is displayed? If not,...

fopen for a network path file
hey ppl, can u pls help me out on this.i am able to easily open a file with fopen in a network path but when i use it as a service with the same fopen function it relly doesnt work.if i write log for the function it says not able to open the file? can u tell why is that so???? why this discrepany when i use it as a windows service and not in an application? pls help me out thanks!!! On Sep 26, 5:06 pm, sriram bala <sriramga...@gmail.com> wrote: > hey ppl, > > can u pls help me out on this.i am able to easily open a file with > fopen in a network path but when i use it as a...

How to substitute for a non-existing column in a joined table
Hi, Is there a simpler way than a UNION to return a default value of a joined table for which a corresponding row does not exist? The following example (not a working one, of course) illustrates what I'm after. I'd like to return 'N/A' as c2name if there is no matching row in t2 SELECT t1.c1 (CASE t2.t1pk WHEN NULL THEN 'N/A' ELSE t2.name END) AS c2name, FROM t1 LEFT JOIN t2 ON t2.t1pk = t1.pk Thanks. On 2010-04-21 21:05, bob wrote: > Is there a simpler way than a UNION to return a default value of a joined > table for which a ...

Can't check autofilter
I have problem about filters. I can't use filters by checking in box in Autofilter Menu (in red box in the picture) but I can use other filters normally. I don't know how it happen but I want to use it again. Please help me. [image: http://www.uppic.net/ip/12problem.jpg] -- jatupal ------------------------------------------------------------------------ jatupal's Profile: http://www.citrixguide.com2235 View this thread: http://www.citrixguide.com/showthread.php?t=63821 ...

EXCH2003 - OWA
In our organization, we have a master contact list as Contacts in our public folders. In OWA we can see and get access to those contacts, but when you double-click on a contact card, the button to send email to this contact is grey-ed out. The contacts associated with my mailbox has that option available. any thoughts???? ???????? ...

Outlook 2003 Add-in: Personal Folders Backup uninstall problem
Hello techie nerds out there Help! I am trying to uninstall this utility to reinstall it on another desktop on the same machine. It seems you can only run this utility on one desktop? Running windows XP pro and Outlook 2002 The programme does not show up in the Add/Remove programme window in the Control Panel. Many, many thanks Paul Paul Allen <ict@wandsworthvb.org.uk> wrote: > I am trying to uninstall this utility to reinstall it on > another desktop on the same machine. It seems you can only > run this utility on one desktop? Doesn't seem to be the case here. ...

Search folders Otlk-2003 don't work?
I create a new search folder in OUtlook folder with the criteria, "mail to and from certain people". And then I choose a person from the list. The email address for that person has always been the same. However the search folder only comes up with mail I have SENT to that person, not mail they have sent to me. Whats with that? thanks... jf ...

Understanding Rehoming Public Folders
Hey guys, need some clarification. Under Exchange 5.5 I have public folders replicating to Exchange 2003. The home server option to rehome the public folder under 5.5, by changing this to point to the 2003 server, it won't remove it from the 5.5 server will it?? you should read the article written by William Boswell Great approach http://msexchange911.org/index.php?option=com_smf&Itemid=32&topic=204.0 oz -- Best regards, Good Luck Oz Ozugurlu ____________________________ MCSE 2003 M+,S+, CCNA Http://www.msexchange911.org Http://www.consultusa.us (Blog) "Mike" wr...

Why is Outlook 2003 synchronizing folders from a PoP email account!
I have one internet email account. No Exchange. I loaded Outlook 2003 3 days ago. All of a sudden. Today, it is synchronizing my folders. It takes forever and seems to be in some kind of a loop. 2 hours and still no email downloaded. Let the games begin, again. Another product from Microsoft with major bugs right out of the shoot. SP1 ready yet? Any Microsoft employees here care to tell me how to disable the synchronization of my folders to other folders that don't exist? Do you care to tell us what options you selected before shooting off your opinions about Microsoft???? --� Milly S...

Add a nwe mail folder with new email address
I want to add a new folder within the mail area in Outlook 2003. opened up an additional email account with my IP and want that email t go to a seperate main folder in outlook. Under All Mail Folders I'v got Personal Folders and Hotmail as root folders in the area. I wan to add another root folder for my new email only. Thank you, Crai ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com Apart from special accounts like HTTP and IMAP when you collect POP3 then all mess...

email defaults to personal folder
Hello we have run into a new problem at my work. About 5 new people started recently and the all tried to open their email accounts before they were properly setup. Because no server was entered they now have a top folder called "Personal Folders". What we have been doing to fix the situation is to right click on the outlook icon choose > properties > email accounts > Add a new email account. This method then adds the user's mailbox to outlook. The problem however is that we have lost old calendar information as well as the mail defaults to the personal folder ...

Exchange GAL to Local COntacts Folder Export Script
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: Exchange Hi, <br><br>I wonder if anyone has created an AppleScript that exports a copy of the GAL to a local Contacts folder in Entourage 2008? <br><br>I can do this manually, but finding all contacts in the GAL using an Advanced search and copying them manually to a folder. But our CEO would like this automated and I am unfamiliar with scripting techniques in Mac OS X Snow Leopard. <br><br>I have spent approx. 4 hours trying to find out if this is possible wit...

Check box question 04-23-07
I have a form with a check box used to indicate if a receipt is voided or not. What I'm trying to do is go to a new record after the checkbox is marked. I have the following code in place and it works. Kinda. The problem is that if I then go back and UNCHECK the check box, it sends me to a new record again. Here's the code: Private Sub Check43_AfterUpdate() If Ckeck43 = Yes Then DoCmd.GoToRecord , , acNewRec Thanks for any help! End Sub The following works fine for me. If Me.Check3 = True Then DoCmd.GoToRecord , , acNewRec so try If Ckeck43 = True Then DoCmd.GoToRecor...

Outlook 2000
I'm having a strange Outlook issue and cannot figure it out for the life of me. Our mail server is Exchange 5.5 (can't recall the SP right now), and the Client is Outlook 2000 SR-1. The user can view his primary email box without any troubles, but also has access to another Exchange email box. He can view every folder in it except the Sent Items. The error it returns is "Unable to display the folder". What's strange is he can view the subfolder in Sent Items, no problem. I've configured his email on a different PC, and everything shows up fine, so I know ...

Emails diverted to Drafts folder
Windows Mail: I'm seeing incoming mail going into the Drafts folder, and outgoing mail saved to the Drafts folder. Not all mail, but a lot of it. The same is happening in Windows 7 with Live Mail using a POP3 ISP account, not Hotmail. On the computers on which I've seen it, it's a relatively recent problem that didn't exist before. Possibly related to some Windows Update? I have some very irritated people badgering me about this and just can't find an answer. Any light on the subject would be warmly welcomed. -- Anna I have not heard of this particular pro...

how can i present a JPG in a window having cell with the path?
I build a catalog for coins collection with Excel. each row represents a coin (record). in two cells (fields) i have a path to both sides of the coin scanned as a JPG files in the specific directory. i would like the following scenario: when i stand on a specific row (any cell), the relevant images are presented in 2 big windows. when i move to another row, the image automatically changes etc. i would like also to control the size of the window. would appreciate your help, thanks, sam Hi Sam See if this gets you started: Insert an Image1 from the activex coltrols toolbox. S...

Public Folder Permissions #36
I need to take ownership of several calender based public folders. I apologize as to the lack of skill here. I have just been handed this job and I am trying to do the best I can. Any and all help would be most appreciated. Thanks Open Exchange system manager, expand admin groups, folder public folder. Locate the folder, properties, permissions, client permissions, add yourself as owner. James Chong (MVP) MCSE | M+, S+, MCTS, Security+ msexchangetips.blogspot.com On Apr 17, 12:32 pm, James <J...@discussions.microsoft.com> wrote: > I need to take ownership of several calender...

reality check: 1GB mailboxes?
Is anyone else getting pressure to compete with GMail and offer 1GB mailboxes to their Exchange Server 2003 users? To me, Exchange is a messaging/collaboration platform, not a file server. The issue I'm faced with lately is file attachments on email messages. They can be anywhere from 20KB to 50MB (or more). Limiting the file attachment size means finding an alternative to sending/receiving files that don't make the cut. Since sending email with attachments is so pervasive and easy (albeit, insecure), asking users to send/receive files another way could result in a decrease in ...

Programmatically adding function to copy all incoming mail to public folder (based on sender domain)
Hi all. I would like to be able to (from any client) execute a script (vbs, exe, whatever) that creates a public folder. That's should be pretty easy. The tricky part is that I want the same script to create a rule (?) on the Exchange server that copies all incoming mail from a specific sender domain to that new public folder. Hmm... Let us assume that I have the sufficient credentials for this action hardcoded in the script.. does anyone have a good idea how to do that. I am creating an interface in our ERP software that should be able to see mail correspondance horizontically accross ...

Archives Personal Folders File
In Outlook 98, I can't seem to make the Archive folder appear permanently right above the current Outlook Personal Folder in the left hand Folders List. Archiving doesn't seem to work. I get an odd error message: "Error while aging Store Personal Folders. Errors in Archive.pst. Quit Mail applications and use the Inbox Repair Tool." I find no such tool. Outlook 98 just has confusing documentation, don't know why. The Inbox Repair Tool is a file called scanpst.exe -- search your hard drive for it, then run it and follow the prompts to fix any errors in your archi...

can't manage public folders
I'm hoping someone can help me with this. I posted it a few weeks ago, but am hoping it was missed because of the holiday. I hope someone can help me with this. I had an Exchange 2000 server and added an Exchange 2003 server and migrated over all of the mailboxes. At some point, something happened and I was no longer able to modify the security / rights in the public folders like I used to be able to. I could set up new folders and I'm able to modify those, but not the old ones. I've since uninstalled the Exchange 2000 server, hoping that would solve the problem. It didn...

removing "all mail folders" from left "Mail" view
I am a new user to Outlook and am using Outlook 2003. On the left side of my screen, there is a column called MAIL. It has a FAVORITES folder near the top and under that there is a ALL MAIL FOLDERS area. Is there a way to delete the ALL MAIL FOLDERS area? The only folders I use are above it in the FAVORITES area. TIA No. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no a...

Outlook Archive Folders
I am trying to set up archive folders for email to identically match my various inbox folders. how do i do this? Juanita STEP 1: Right click on your inbox and go to properties / click on the AutoArchive tab and select the Archive this folder using these setting option and set the path of the archive folder to a specific location. Click ok. Then STEP 2: Click on Tools / Options and click on the other tab Select Auto Archive Button. Make sure this location of the archive file is the save location as the above archive file from STEP 1. I hope this helps you out! Thanks "Juanita"...