Access/VBA Library

INI_Filename

This Private function returns the full path of the INI-file of the current project.

Syntax

INI_Filename()
Return value

String : Path to the INI-file.

Code
Private Function INI_Filename() As String

    Static filename As String
    
    If IsEmptyVar(filename) Then
        filename = GetApplicationFolder() & "\" & GetWord(GetApplicationTitle(), 1) & ".ini"
    End If
    
    INI_Filename = filename
End Function
Filesystemtag:Filesystem

Remarks

  • The file name is determined once and stored as a static variable. If you set the AppTitle property after this function is called, the name of the INI-file will not change.
  • When the AppTitle property is set, the first word of this property is the name of the application. I am used to set this property as follows: V. I do not want the version number in the name of the INI-file.

See also

  • GetApplicationFolder
  • GetApplicationTitle
  • GetWord