Results 1 to 4 of 4
  1. #1
    ehe is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    2

    Run-time error 13: type mismatch

    Hi Can anyone Help Please;

    I am trying to select a record in a table base on 3 cretiria selected from a form. Everytime i use findfirst, i get an error "Run-time error 13: type mismatch. here is the code:

    Dim db1 As DAO.Database
    Dim rstHoldings As DAO.Recordset

    Set db1 = CurrentDb

    Trandate = Forms!frm_Transactions!Tran_Date
    TranAcct = Forms!frm_Transactions!Tran_From_acct_ID
    TranInstrmnt = Forms!frm_Transactions!Tran_Instrument_ID

    Set rstHoldings = db1.openRecordset(“tbl_Instrument_Holdings”,dbOpen Dynaset)

    rstHoldings.FindFirst "[HAcct_ID] = " &TranAcct And "[HInstrument_ID] = " & TranInstrmnt And"[Holdings_Date] =" & Trandate

    THanks


  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    rstHoldings.FindFirst "[HAcct_ID] = " &TranAcct & " And [HInstrument_ID] = " & TranInstrmnt & " And[Holdings_Date] = #" & Trandate & "#"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ehe is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    2
    Thanks a lot. That worked.

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem, and welcome to the site by the way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. run-time error '13' type mismatch
    By teebumble in forum Forms
    Replies: 8
    Last Post: 12-03-2012, 01:18 PM
  2. Error: Run-time error '13' Type mismatch
    By uronmapu in forum Access
    Replies: 1
    Last Post: 09-07-2012, 05:38 AM
  3. run-time error 13 , type mismatch
    By Compufreak in forum Programming
    Replies: 8
    Last Post: 08-13-2012, 12:17 AM
  4. Run-time error '13': Type mismatch
    By uronmapu in forum Access
    Replies: 2
    Last Post: 07-10-2012, 07:59 PM
  5. Replies: 1
    Last Post: 05-11-2012, 10:59 AM

Tags for this Thread

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