From: PsyberFox on
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
From: Douglas J. Steele on
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(a)discussions.microsoft.com> wrote in message
news:49222D17-172A-44C0-9197-34E196EE60D7(a)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


From: .Len B on
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(a)discussions.microsoft.com> wrote in message
news:49222D17-172A-44C0-9197-34E196EE60D7(a)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.


From: Daniel Pineault on
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
From: John Spencer on
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,