DLookup Syntex

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could someone tell me what I'm not doing right here??

Dim strEmail As String
Dim strReviewer As String

strReviewer = Me.txtReviewer

Me.txtReviewer.Enabled = True
strEmail = DLookup("", "qryMKEmail", "[ID]=" & strReviewer)

DoCmd.SendObject acSendNoObject, , , strEmail, , "Return Tracker"

Me.txtReviewer.Enabled = False
 
Could someone tell me what I'm not doing right here??

If strReviewer is a string (which it seems to be by the name)
you need single quotes around it:

strEmail = DLookup("", "qryMKEmail", "[ID]='" & strReviewer & "'")

Tom Lake
 
Not sure where the problem is occuring,
As Tom said, a string needs quotes.
But, is txtReviewer As String?
and is ID a string?
If not, then strReviewer should become intReviewer etc..

Tom Lake said:
Could someone tell me what I'm not doing right here??

If strReviewer is a string (which it seems to be by the name)
you need single quotes around it:

strEmail = DLookup("", "qryMKEmail", "[ID]='" & strReviewer & "'")

Tom Lake
[/QUOTE]
 

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

Similar Threads

Dlookup Frustration 2
Email Subject Line 12
Attachments 1
Get Data From List Box Selection 2
Qualifier Must Be Collection 1
Help with VB 5
Attachments 4
Opening an access email by double clicking on a text area 2

Back
Top