Access web app - Data Macro - Where Condition for new record

Anonymous
2015-09-16T14:58:36+00:00

This works fine to send an email after new record is created. I’ve tested it. However, without the Where Condition under “Look up a record in” it just defaults to record ID=1. How can I set the Where Condition to get the highest ID (for the new record just created)? Doesn’t seem to be a Max function that I can find. 

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

15 answers

Sort by: Most helpful
  1. Anonymous
    2015-09-16T19:14:38+00:00

    Hmm, that won't really work because the Table is like a bucket of water, it can't tell new water from old water.  I would suggest you base it off a query and use the DoCmd.RunCommand acCmdRecordsGoToLast.  You might have to run a Me.Requery if doing via a Form.

    0 comments No comments
  2. Anonymous
    2015-09-16T19:57:40+00:00

    No, this is an Access web app, so all macros, not VBA. Should be a simple syntax, even if there's a prior macro to build upon. Other ideas, anyone?

    0 comments No comments
  3. Anonymous
    2015-09-16T21:23:15+00:00

    Missed the Web App but you should still be able to use DoCmd in a macro or something similar to get to the last record.

    0 comments No comments
  4. Anonymous
    2015-09-16T21:42:59+00:00

    How about ID=Forms!myform.controls(”ID”)

    0 comments No comments
  5. Anonymous
    2015-09-16T22:54:32+00:00

    Thanks. I think it's the "something similar" I'm looking for. Just the correct syntax. All I need is to do is get the max ID for the last record which has already been created. Where condition needs to refer to [tblStaffDirectoryData].[ID]. Find the max of that.

    0 comments No comments