From: Tom van Stiphout on 15 May 2010 09:27 On Sat, 15 May 2010 08:33:22 -0400, "Mark Andrews" <mandrews___NOSPAM___(a)rptsoftware.com> wrote: One option would be to check with Wayne Phillips at everythingaccess.com. He might be able to provide a safe solution along the lines of this article: http://www.everythingaccess.com/tutorials.asp?ID=A-new-method-for-disabling-the-Mouse-Scroll-Wheel-in-Access-forms -Tom. Microsoft Access MVP >Tom, > >Thanks for the info. I think I found two ways to do it: >- the way you pointed out which you pass the root folder (however the >downside is you lose the ability to browse around, you can only browse from >that root folder down) However this way is supported. >- Stephan lebans code (which does exactly what I want, shows entire tree but >navigates to folder passed in) >However downsides are that you need to duplicate code and put it in every >form in which you want this functionality otherwise your program will crash. >It looked like this was done about 7 years ago, so basically just wondered >if any newer better ways were possible? > >I just didn't want to duplicate code in 10 forms and try not to use code >that might cause crashes. > >If you know of any betters ways let me know, >Thanks for your help, >Mark > >"Tom van Stiphout" <tom7744.no.spam(a)cox.net> wrote in message >news:be7su5lbiukgqoikq41q4j1tf5vsoe6e5s(a)4ax.com... >> On Fri, 14 May 2010 14:33:18 -0400, "Mark Andrews" >> <mandrews___NOSPAM___(a)rptsoftware.com> wrote: >> >> You wrote: >> Also don't like that the code must exist in the form class module >> instead of a normal module. >> >> I ask: why not? Aren't class modules full citizens in the Access >> world? >> >> That said, there certainly is a way to set a default folder. Check >> this out: >> http://msdn.microsoft.com/en-us/library/bb774065%28VS.85%29.aspx >> >> -Tom. >> Microsoft Access MVP >> >> >> >>>What? >>> >>>I'm looking for a way to supply a default folder to the Browse For Folder >>>dialog when using it from VBA code. >>> >>>Example: A form has a field with a folder path, when clicking on a button >>>the "Browse For Folder" dialog box displays and by default >>>starts at the folder path I supply (based on this field on the form). >>> >>>Stephan Lebans code does exactly what I want I just don't like all the >>>warnings about using it certain ways or the program will crash. >>>Also don't like that the code must exist in the form class module instead >>>of >>>a normal module. >>> >>>Mark >>> >>>"J�rn Bosse" <JrnBosse(a)discussions.microsoft.com> wrote in message >>>news:76E35220-E833-45D5-8FD5-BE39DCC3AAF0(a)microsoft.com... >>>> Hi, >>>> >>>> I would solve this with a Public Function in an extra module. Something >>>> like >>>> this >>>> >>>> Public Function DefaultPath() As String >>>> Const strDefaultpath As String = "C:\Program Files" >>>> DefaultPath = strDefaultpath >>>> End Function >>>> >>>> You can use this like this: >>>> Debug.Print DefaultPath >>>> >>>> J�rn
From: Mark Andrews on 16 May 2010 19:38
Tom, Thanks for the info. If I can't get it solved perhaps I'll use this advice and contact Wayne. Appreciate the help, Mark "Tom van Stiphout" <tom7744.no.spam(a)cox.net> wrote in message news:l48tu59obbdlvglrmlbqbl19b5851necrr(a)4ax.com... > On Sat, 15 May 2010 08:33:22 -0400, "Mark Andrews" > <mandrews___NOSPAM___(a)rptsoftware.com> wrote: > > One option would be to check with Wayne Phillips at > everythingaccess.com. He might be able to provide a safe solution > along the lines of this article: > http://www.everythingaccess.com/tutorials.asp?ID=A-new-method-for-disabling-the-Mouse-Scroll-Wheel-in-Access-forms > > -Tom. > Microsoft Access MVP > > >>Tom, >> >>Thanks for the info. I think I found two ways to do it: >>- the way you pointed out which you pass the root folder (however the >>downside is you lose the ability to browse around, you can only browse >>from >>that root folder down) However this way is supported. >>- Stephan lebans code (which does exactly what I want, shows entire tree >>but >>navigates to folder passed in) >>However downsides are that you need to duplicate code and put it in every >>form in which you want this functionality otherwise your program will >>crash. >>It looked like this was done about 7 years ago, so basically just wondered >>if any newer better ways were possible? >> >>I just didn't want to duplicate code in 10 forms and try not to use code >>that might cause crashes. >> >>If you know of any betters ways let me know, >>Thanks for your help, >>Mark >> >>"Tom van Stiphout" <tom7744.no.spam(a)cox.net> wrote in message >>news:be7su5lbiukgqoikq41q4j1tf5vsoe6e5s(a)4ax.com... >>> On Fri, 14 May 2010 14:33:18 -0400, "Mark Andrews" >>> <mandrews___NOSPAM___(a)rptsoftware.com> wrote: >>> >>> You wrote: >>> Also don't like that the code must exist in the form class module >>> instead of a normal module. >>> >>> I ask: why not? Aren't class modules full citizens in the Access >>> world? >>> >>> That said, there certainly is a way to set a default folder. Check >>> this out: >>> http://msdn.microsoft.com/en-us/library/bb774065%28VS.85%29.aspx >>> >>> -Tom. >>> Microsoft Access MVP >>> >>> >>> >>>>What? >>>> >>>>I'm looking for a way to supply a default folder to the Browse For >>>>Folder >>>>dialog when using it from VBA code. >>>> >>>>Example: A form has a field with a folder path, when clicking on a >>>>button >>>>the "Browse For Folder" dialog box displays and by default >>>>starts at the folder path I supply (based on this field on the form). >>>> >>>>Stephan Lebans code does exactly what I want I just don't like all the >>>>warnings about using it certain ways or the program will crash. >>>>Also don't like that the code must exist in the form class module >>>>instead >>>>of >>>>a normal module. >>>> >>>>Mark >>>> >>>>"J�rn Bosse" <JrnBosse(a)discussions.microsoft.com> wrote in message >>>>news:76E35220-E833-45D5-8FD5-BE39DCC3AAF0(a)microsoft.com... >>>>> Hi, >>>>> >>>>> I would solve this with a Public Function in an extra module. >>>>> Something >>>>> like >>>>> this >>>>> >>>>> Public Function DefaultPath() As String >>>>> Const strDefaultpath As String = "C:\Program Files" >>>>> DefaultPath = strDefaultpath >>>>> End Function >>>>> >>>>> You can use this like this: >>>>> Debug.Print DefaultPath >>>>> >>>>> J�rn |