Results 1 to 4 of 4
  1. #1
    Merkava is offline Novice
    Windows XP Access 2002
    Join Date
    Nov 2009
    Posts
    20

    Sending parameters to queries - Revisited

    Hello All,

    Chris was a great help with this subject. I have two questions

    Sub QueryTest()
    Dim qryTemp As Object
    Dim rstTemp As Object
    ' Ordinal position of Parameter.
    Const StartDate As Date = "12/1/07"

    Set qryTemp = CurrentDb.QueryDefs("qryActivityLogByDate")
    qryTemp.Parameters(StartDate) = Date

    Set rstTemp = qryTemp.OpenRecordset
    'Personal Details

    rstTemp.Close
    Set rstTemp = Nothing

    qryTemp.Close
    Set qryTemp = Nothing

    End Sub
    Question #1 - I am receiving Data Type conversion error. What is this and how would I avoid ths.



    Question #2 - I there a source of information in a simple format?

    Thank you in advance.

    Cheers,
    Aaron

  2. #2
    Merkava is offline Novice
    Windows XP Access 2002
    Join Date
    Nov 2009
    Posts
    20
    Would someone be able to point to me where I can read about this issue. I need to resolve it

    Cheers,
    Aaron

  3. #3
    PianoMan64 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    29
    Quote Originally Posted by Merkava View Post
    Hello All,

    Chris was a great help with this subject. I have two questions

    Sub QueryTest()
    Dim qryTemp As Object
    Dim rstTemp As Object
    ' Ordinal position of Parameter.
    Const StartDate As Date = #12/1/07# ' When Defining a DATE in MS Access using the # sign to enclose the date or datetime specified.

    Set qryTemp = CurrentDb.QueryDefs("qryActivityLogByDate")
    qryTemp.Parameters(StartDate) = Date

    Set rstTemp = qryTemp.OpenRecordset
    'Personal Details

    rstTemp.Close
    Set rstTemp = Nothing

    qryTemp.Close
    Set qryTemp = Nothing

    End Sub
    Question #1 - I am receiving Data Type conversion error. What is this and how would I avoid ths.

    Question #2 - I there a source of information in a simple format?

    Thank you in advance.

    Cheers,
    Aaron
    Code:
    Const StartDate As Date = #12/1/07# ' When Defining a DATE in MS Access using the # sign to enclose the date or datetime specified.

  4. #4
    Merkava is offline Novice
    Windows XP Access 2002
    Join Date
    Nov 2009
    Posts
    20
    Hello,

    I am still getting the data conversion error on this line

    qryTemp.Parameters(StartDate) = Date

    Cheers,
    Aaron

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

Similar Threads

  1. Send parameters to queries
    By Merkava in forum Programming
    Replies: 8
    Last Post: 11-06-2009, 02:31 PM
  2. Fields order changes on sending to excel
    By captgnvr in forum Import/Export Data
    Replies: 1
    Last Post: 10-01-2009, 09:29 AM
  3. VB code for sending email through Option Group?
    By getdpt in forum Programming
    Replies: 0
    Last Post: 08-23-2009, 03:59 PM
  4. SENDING EMAIL MESSAGES DIRECTLY FROM ACCESS
    By Frenchos in forum Access
    Replies: 0
    Last Post: 07-20-2007, 12:51 AM
  5. Sending email via Outlook (and Exchange2003) from Access2003
    By Larry Elfenbein in forum Programming
    Replies: 0
    Last Post: 11-15-2005, 09:03 PM

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