Thanks, but this does not use a form. This is an Access web app which is SQL Server on the back end and HTML5 on the form/view side. Just looking for the ID of the last record that was created in the table.
Access web app - Data Macro - Where Condition for new record
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.
15 answers
Sort by: Most helpful
-
Anonymous
2015-09-16T22:57:51+00:00 -
Anonymous
2015-09-18T23:43:26+00:00 How about html tag mailto?
please visit
http://shanghaizpy.mvip8.xyz/a/default2.aspx
the link is a little web sample by asp.net.
And google mailto also.
-
Anonymous
2015-09-19T00:55:28+00:00 Thank you, but no, the problem is not with sending the email. The Send Email action works fine. All I'm trying to do is find the last record created in the table, so I can reference a value from that. I have found a solution, and I will post it separately.
-
Anonymous
2015-09-19T01:04:01+00:00 Solution found. Since Data Macros for Access web apps does not include a Max function to find the last record, we came up with a workaround. We added a new field to the table, named EmailSent (Yes/No), set all the previous records values to "Yes". Then, when new record created, the value of EmailSent defaulted to "No" so we could pick that record. Then, we were able to grab the info needed from that record to include in the email notification. After the email was sent, we set the value of EmailSent to "Yes." Thanks everybody for your suggestions.
-
Anonymous
2015-09-21T21:00:08+00:00 The standard way and means to get the last “max” record in Access web applications is to create a query sorted by descending.
You then simply grab the first record via the lookup a record command. By sorting correctly you always get the first record, and with a sort descending on the desired max column value, then the first record will be the max record.
And you flag solution is certainly viable and thus gives you a means to track if emails were sent. (somewhat prefer your approach). However I wanted to share with you and the folks here that while no "max" command exists, you can achieve the same results by using lookup record based on a correctly sorted query.
Regards,
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada