Form Field use in a DMAX Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to use an Account Number in a query by using a the value supplied by a
form field in a DMAX Function.

I already have the Form Field working successfully in the WHERE Clause (If I
can use the same syntax, It would be acceptable), it is only in the DMAX
function, that I get the error displayed in the MS Word Document.

UPDATE ACCT SET ACCT.DT_EQ_1STREP =

DMax("[DT_REPORT]","REPORTS","[ACCT_ID] = [Forms]![Account]![Acct_ID] and
[AGENCY] = 'EQ' ") <<<<<< This Does Not Work

WHERE (((ACCT.ID)=[Forms]![Account]![Acct_ID])); <<<<<<< This Works

Question - Can this be done, and if yes, what is my syntax error? I suspect
it is not straight forward and may not be able to be done at all.

Thanks
 
.... DMax("[DT_REPORT]","REPORTS","[ACCT_ID] = " &
[Forms]![Account]![Acct_ID] & " AND [AGENCY] = 'EQ' ") ...

(Assuming [Acct_ID] is numeric - your WHERE statement indicates that this
is the case.)

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top