E-Mail Command Button

I

Ickus

I can't seem to get my e-mail button to work. I have a book that says I can
do it with a DLookUp command.
This does open the E-Mail but always puts the 1st records e-mail address in
the To: Box.
Where am I going wrong?
My function currently stands at:
=DLookUp("[E-Mail Address]", "Contacts", "[ID])

I also seem to be having a problem with the save to Outlook command. When I
create a command button with the run command macro for Save contact to
Outlook, it all seems fine until I go to form view, Click on the button, and
the following message appears "The Command or action 'SaveAsOutlookContact'
isn't available now". Do you know how to stop this. When I look at it in the
example templates, it works, but not for my database.
This has had me pulling my hair out now for a few days, I bet they are both
really simple to sort.

Please help

Thanks
 
D

Douglas J. Steele

The third argument of DLookup is supposed to be a WHERE clause (without the
word WHERE in it).

Assuming that the ID is a numeric field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]=" & [ID])

If ID is a text field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]='" & [ID] & "'")

Exagerated for clarity, that's

=DLookUp("[E-Mail Address]", "Contacts", "[ID]= ' " & [ID] & " ' ")
 
I

Ickus

Douglas, it did not work. it came up with a message 'Action Failed'

I have put in the function the [ID] as it is the primary key & should link
the e-mail to the record it came from.

Any other ideas?

Thanks

Samuel

Douglas J. Steele said:
The third argument of DLookup is supposed to be a WHERE clause (without the
word WHERE in it).

Assuming that the ID is a numeric field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]=" & [ID])

If ID is a text field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]='" & [ID] & "'")

Exagerated for clarity, that's

=DLookUp("[E-Mail Address]", "Contacts", "[ID]= ' " & [ID] & " ' ")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ickus said:
I can't seem to get my e-mail button to work. I have a book that says I can
do it with a DLookUp command.
This does open the E-Mail but always puts the 1st records e-mail address
in
the To: Box.
Where am I going wrong?
My function currently stands at:
=DLookUp("[E-Mail Address]", "Contacts", "[ID])

I also seem to be having a problem with the save to Outlook command. When
I
create a command button with the run command macro for Save contact to
Outlook, it all seems fine until I go to form view, Click on the button,
and
the following message appears "The Command or action
'SaveAsOutlookContact'
isn't available now". Do you know how to stop this. When I look at it in
the
example templates, it works, but not for my database.
This has had me pulling my hair out now for a few days, I bet they are
both
really simple to sort.

Please help

Thanks
 
D

Douglas J. Steele

What exactly did you change your function to?

I should have asked earlier for clarification of exactly what you meant by
using a DLookUp command to get an "e-mail button to work". First, what do
you mean by an e-mail button? (i.e.: what does making it work mean?) And
exactly how are you using the DLookup?


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ickus said:
Douglas, it did not work. it came up with a message 'Action Failed'

I have put in the function the [ID] as it is the primary key & should link
the e-mail to the record it came from.

Any other ideas?

Thanks

Samuel

Douglas J. Steele said:
The third argument of DLookup is supposed to be a WHERE clause (without
the
word WHERE in it).

Assuming that the ID is a numeric field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]=" & [ID])

If ID is a text field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]='" & [ID] & "'")

Exagerated for clarity, that's

=DLookUp("[E-Mail Address]", "Contacts", "[ID]= ' " & [ID] & " ' ")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ickus said:
I can't seem to get my e-mail button to work. I have a book that says I
can
do it with a DLookUp command.
This does open the E-Mail but always puts the 1st records e-mail
address
in
the To: Box.
Where am I going wrong?
My function currently stands at:
=DLookUp("[E-Mail Address]", "Contacts", "[ID])

I also seem to be having a problem with the save to Outlook command.
When
I
create a command button with the run command macro for Save contact to
Outlook, it all seems fine until I go to form view, Click on the
button,
and
the following message appears "The Command or action
'SaveAsOutlookContact'
isn't available now". Do you know how to stop this. When I look at it
in
the
example templates, it works, but not for my database.
This has had me pulling my hair out now for a few days, I bet they are
both
really simple to sort.

Please help

Thanks
 
I

Ickus

Douglas,

Like I said, I'm probably just being dim, but here's what I'm trying to do.

I created a command button with an embedded macro, using the sendobject
command. I've followed a book that said it was easiest using the DLookUp
command (see my earlier attempt), I can get outlook to open but it always
seems to use the 1st records e-mail address. I want to make it so that it
uses the records e-mail address to paste it straight into Outlook.

I did copy the e-mail button from the template for contacts but that did not
work.

How can I make sure that only the record being looked at will be used for
the e-mail address. that is why I used the [ID] as it was the primary key for
my contacts table, therefore being unique.

Where am I going wrong.



Douglas J. Steele said:
What exactly did you change your function to?

I should have asked earlier for clarification of exactly what you meant by
using a DLookUp command to get an "e-mail button to work". First, what do
you mean by an e-mail button? (i.e.: what does making it work mean?) And
exactly how are you using the DLookup?


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ickus said:
Douglas, it did not work. it came up with a message 'Action Failed'

I have put in the function the [ID] as it is the primary key & should link
the e-mail to the record it came from.

Any other ideas?

Thanks

Samuel

Douglas J. Steele said:
The third argument of DLookup is supposed to be a WHERE clause (without
the
word WHERE in it).

Assuming that the ID is a numeric field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]=" & [ID])

If ID is a text field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]='" & [ID] & "'")

Exagerated for clarity, that's

=DLookUp("[E-Mail Address]", "Contacts", "[ID]= ' " & [ID] & " ' ")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I can't seem to get my e-mail button to work. I have a book that says I
can
do it with a DLookUp command.
This does open the E-Mail but always puts the 1st records e-mail
address
in
the To: Box.
Where am I going wrong?
My function currently stands at:
=DLookUp("[E-Mail Address]", "Contacts", "[ID])

I also seem to be having a problem with the save to Outlook command.
When
I
create a command button with the run command macro for Save contact to
Outlook, it all seems fine until I go to form view, Click on the
button,
and
the following message appears "The Command or action
'SaveAsOutlookContact'
isn't available now". Do you know how to stop this. When I look at it
in
the
example templates, it works, but not for my database.
This has had me pulling my hair out now for a few days, I bet they are
both
really simple to sort.

Please help

Thanks
 
D

Douglas J. Steele

To be honest, I've never used embedded macros, so I may not be able to help
that much.

What are the actions in the macro? The DLookup would be used to provide a
To, CC or Bcc value for the SendObject action.

You mentioned that you have a book that said to use DLookup. Did it say how
to use DLookup? What book is it?


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ickus said:
Douglas,

Like I said, I'm probably just being dim, but here's what I'm trying to
do.

I created a command button with an embedded macro, using the sendobject
command. I've followed a book that said it was easiest using the DLookUp
command (see my earlier attempt), I can get outlook to open but it always
seems to use the 1st records e-mail address. I want to make it so that it
uses the records e-mail address to paste it straight into Outlook.

I did copy the e-mail button from the template for contacts but that did
not
work.

How can I make sure that only the record being looked at will be used for
the e-mail address. that is why I used the [ID] as it was the primary key
for
my contacts table, therefore being unique.

Where am I going wrong.



Douglas J. Steele said:
What exactly did you change your function to?

I should have asked earlier for clarification of exactly what you meant
by
using a DLookUp command to get an "e-mail button to work". First, what do
you mean by an e-mail button? (i.e.: what does making it work mean?) And
exactly how are you using the DLookup?


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ickus said:
Douglas, it did not work. it came up with a message 'Action Failed'

I have put in the function the [ID] as it is the primary key & should
link
the e-mail to the record it came from.

Any other ideas?

Thanks

Samuel

:

The third argument of DLookup is supposed to be a WHERE clause
(without
the
word WHERE in it).

Assuming that the ID is a numeric field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]=" & [ID])

If ID is a text field, try:

=DLookUp("[E-Mail Address]", "Contacts", "[ID]='" & [ID] & "'")

Exagerated for clarity, that's

=DLookUp("[E-Mail Address]", "Contacts", "[ID]= ' " & [ID] & " ' ")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I can't seem to get my e-mail button to work. I have a book that says
I
can
do it with a DLookUp command.
This does open the E-Mail but always puts the 1st records e-mail
address
in
the To: Box.
Where am I going wrong?
My function currently stands at:
=DLookUp("[E-Mail Address]", "Contacts", "[ID])

I also seem to be having a problem with the save to Outlook command.
When
I
create a command button with the run command macro for Save contact
to
Outlook, it all seems fine until I go to form view, Click on the
button,
and
the following message appears "The Command or action
'SaveAsOutlookContact'
isn't available now". Do you know how to stop this. When I look at
it
in
the
example templates, it works, but not for my database.
This has had me pulling my hair out now for a few days, I bet they
are
both
really simple to sort.

Please help

Thanks
 
I

Ickus

Douglas,

I seem to have sorted it now. It seems that my original database had a bug
in it that would not let the function work.

Thanks for all your help.

Samuel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top