Home Privacy Policy Feedback Link to us Site Map

Access: CurDir Function


In Access, the CurDir function returns the current path.

The syntax for the CurDir function is:

CurDir ( drive )

drive is an optional parameter. If this parameter is omitted, the CurDir function assumes the current drive.


For example:

CurDir () would return "C:\Documents and Settings\user\My Documents"
CurDir ("G") would return "G:\"

VBA Code

The CurDir function can be used in VBA code. For example:

Dim LResult As String

LResult = CurDir ()

In this example, the variable called LResult would now contain the value "C:\Documents and Settings\user\My Documents".


SQL/Queries

You can also use the CurDir function in a query.