Looking up a field value to include in an email
I have a page used to add a record to a table, which also triggers an email.
The table structure includes:
The form is adding a record to the nominations table, including the field CategoryFullID.
I would like the email to include the Category field for the CategoryFullID in the form, but can't pull it directly from a form value, as the form is only adding the CategoryFullID, and not referencing the Category itself.
I have had a stab at it, by trying to
- store the CategoryFullID value in a session (CategoryValue) when the form is submitted.
- use a query (rsCategories) to return the record from the categoriesFull table where the CategoryID = the value stored in the session.
- echo the Category value fro that record in the email.
I hope that makes sense - I'm sure it must be possible, even if my attempt is all wrong!
Copy of the file and other details below.