WineSnob Not Bright but TENACIOUS Local time Today, 08:55 Joined Aug 9, 2010 Messages 211 Sep 18, 2014 #1 I am trying to open a form using the where clause to max of a table field. I cannot get the syntax correct. Code: DoCmd.OpenForm "frmInput", , , Max(tblClients.ClientID) AS MaxOfClientID FROM tblClients
I am trying to open a form using the where clause to max of a table field. I cannot get the syntax correct. Code: DoCmd.OpenForm "frmInput", , , Max(tblClients.ClientID) AS MaxOfClientID FROM tblClients
pbaldy Wino Moderator Staff member Local time Today, 05:55 Joined Aug 30, 2003 Messages 36,270 Sep 18, 2014 #2 Something like "ClientID = " DMax("ClientID","tblClients")
P plog Banishment Pending Local time Today, 07:55 Joined May 11, 2011 Messages 11,980 Sep 18, 2014 #3 MAX is a SQL function, you can't use SQL right there. Instead you should use the DMAX function (http://www.techonthenet.com/access/functions/domain/dmax.php). However, that's just going to return a value, you need to set a value from the form equal to it to use as criteria. What field in the form do you want to equal the value?
MAX is a SQL function, you can't use SQL right there. Instead you should use the DMAX function (http://www.techonthenet.com/access/functions/domain/dmax.php). However, that's just going to return a value, you need to set a value from the form equal to it to use as criteria. What field in the form do you want to equal the value?
WineSnob Not Bright but TENACIOUS Local time Today, 08:55 Joined Aug 9, 2010 Messages 211 Sep 18, 2014 #4 Thanks AGAIN Paul
pbaldy Wino Moderator Staff member Local time Today, 05:55 Joined Aug 30, 2003 Messages 36,270 Sep 18, 2014 #5 Happy to help!