
LMax = DMax("UnitPrice", "Order Details", "OrderID = 10248") The DMax function can be used in VBA code in Microsoft Access. WHERE (((.OrderID)=10248)) Example in VBA Code This is the same as the following SQL statement: SELECT Max(.UnitPrice) AS MaxOfUnitPrice In this example, you would return the maximum UnitPrice from the Order Details table where the OrderID is 10248. Let's look at how to use the DMax function in MS Access: DMax("UnitPrice", "Order Details", "OrderID = 10248") The DMax function can be used in the following versions of Microsoft Access:

The DMax function returns a numeric value. It is the WHERE clause to apply to the domain.


The syntax for the DMax function in MS Access is: DMax ( expression, domain, ) Parameters or Arguments expression The field that you wish to find the maximum value for. The Microsoft Access DMax function returns the maximum value from an Access table (or domain). This MSAccess tutorial explains how to use the Access DMax function with syntax and examples.
