Results 1 to 4 of 4
  1. #1
    jonny is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    17

    Passing SQL result into variable

    How can I pass the result of strSQL into "Received_By" variable?


    Code:
        strSQL = "SELECT Employees.[Employee ID], Employees.[Employee Name] " & _
                    "FROM Employees " & _
                    "WHERE Employees.[Employee Name] ='" & Received_By & "';"
    
        objMail.To = Received_By
    Thanks in advance

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Are you saying you want to pass the list of employees to one person or send one email to all the employees in the list?

  3. #3
    jonny is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    17
    I want to pass one person e-mail to "Received_By" string.

  4. #4
    jonny is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    17
    I solved it by:
    Code:
    Dim rs as dao.recordset
     set rs = currentdb.openrecordset(strSQL)
     
     objMail.To = rs![Employee ID]
    Thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. passing along #'s to track packages online
    By Coolpapabell in forum Access
    Replies: 0
    Last Post: 09-11-2009, 08:36 AM
  2. Passing a variable to a form
    By cjamps in forum Forms
    Replies: 0
    Last Post: 03-02-2009, 05:32 AM
  3. Passing Values
    By dromorkid in forum Forms
    Replies: 0
    Last Post: 11-25-2008, 05:04 PM
  4. Passing a value from a variable to an update query
    By MUKUDU99 in forum Programming
    Replies: 0
    Last Post: 08-24-2008, 11:14 PM
  5. Passing parameters to a report
    By elmousa68 in forum Access
    Replies: 0
    Last Post: 12-07-2006, 01:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums