You can use a DLookup:
var = DLookup("fieldName", "queryName", true)
You can also open a recordet, and read the first field of the first record.
Here, with a firehose recordset:
var = CurrentProject.Connection.Execute("queryName").Fields(0).Value
You can use a query and base your form on the query, rather than on a table,
directly.
Vanderghast, Access MVP
"Sean Timmons" <(E-Mail Removed)> wrote in message
news:8AD12D10-0169-4D84-90AC-(E-Mail Removed)...
> I'm running a query to retrieve an e-mail address based on an employee
> name.
> Easy enough.
>
> Now, I'm trying to get the result of this query assigned to a variable to
> I
> can use it in my SendObject command, and I can't figure it out.
>
> I could just cheat and include the e-mail in my form as an invisible
> field,
> but that's not very sporting...
|