View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder Rob van Gelder is offline
external usenet poster
 
Posts: 37
Default Compile Error using Dmax funtion

You need to prefix it with WorksheetFunction.

WorksheetFunction.DMax(..., ..., ...)

You'll note that the function requires 3 arguments, not 2 as you've supplied.

For example:
pk = WorksheetFunction.DMax([tbl_OperatorLogJobData], "OpLogJobDataID", [OpLogJobDataID])


Cheers,
Rob


Little Penny wrote:
Can any one help me determine why I'm getting a compile error when
using the dmax function?


Dim pk As Long


The line of code
pk = DMax("[OpLogJobDataID]", "tbl_OperatorLogJobData")



Do I need to install a reference or add a public function?


Any help would be appreciated