From: PsyberFox on 13 May 2010 09:01 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 13 May 2010 09:17 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 13 May 2010 09:19 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 13 May 2010 09:47 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 18 May 2010 09:09 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,
|
Pages: 1 Prev: Random Sampling Next: Not Enough Memory To Open Form Message |