Drew Wutka
DWUTKA at marlow.com
Thu Aug 21 11:41:16 CDT 2003
No, I was talking about this: Dim db As Database set db=CurrentDB not, Dim strTemp as string strTemp=CurrentDB.Name I would normally do the String process, but I don't do the top one very often. Drew -----Original Message----- From: Charlotte Foust [mailto:cfoust at infostatsystems.com] Sent: Thursday, August 21, 2003 10:53 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Detect the folder where the application resides In Access 2000 and later, you can simply use CurrentProject.Path. And Drew, the reason not to use CurrentDB the way you did is because you're referencing it twice to get the name instead of once to assign it to a variable. Charlotte Foust -----Original Message----- From: Drew Wutka [mailto:DWUTKA at marlow.com] Sent: Thursday, August 21, 2003 6:51 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Detect the folder where the application resides What's with all the looking for a slash? Function DBPath() DBPath=left(CurrentDB.Name,len(CurrentDB.Name)-Len(Dir(CurrentDB.Name))) End Function (I know, I'm using a direct reference to CurrentDB.....never had a problem with it though...) Drew -----Original Message----- From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] Sent: Thursday, August 21, 2003 4:30 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Detect the folder where the application resides On 21 Aug 2003 at 10:28, Brindza Ervin wrote: > Hi, > my application can reside in any folder on any drive, but I want that information. Can someone help me to find the application location? > TIA, > Ervin > Static Function ApplDir() As String Dim strApplDir As String Dim strTemp As String If strApplDir = "" Then strTemp = DBEngine(0)(0).Name strApplDir = Left$(strTemp, InStrRev(strTemp, "\")) End If ApplDir = strApplDir End Function -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com