From: Charno on
I've added an email button to a form 'chill intake'. The button is looking at
a field on the form 'Haulier' and finding the email address for that haulier
in a table called 'Hauliers', it will then open a new blank email with the
Hauliers email address in the 'TO:' box.

The form macro i have for this is : =(DLookUp("[Email
Address]","Hauliers","ID=" & ([Haulier],0)))

However when i click on the button an error occours and access shuts down.
This has only happened after adding the above.
Any ideas?

From: Daryl S on
Charno -

I think the ,0 after [Haulier] is a problem. I removed it. Try this (if
Haulier is a numeric):

=(DLookUp("[Email Address]","Hauliers","ID=" &
[Haulier]))

Or this (if Haulier is text):
=(DLookUp("[Email Address]","Hauliers","ID='" &
[Haulier] & "'"))

--
Daryl S


"Charno" wrote:

> I have added an email button to a form 'Chill intake', which looks at the
> field 'Haulier' and then looks up the email address for the haulier in a
> table called 'Hauliers'. On click the button should open a blank email with
> the hauliers email address in the 'TO:' field.
>
> The form macro i'm using is =(DLookUp("[Email Address]","Hauliers","ID=" &
> ([Haulier],0)))
>
> However when i click on the button it causes an issue that closes Access down.
> Any Ideas?