Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I tried both Integer and Long. Neither worked. I got Data Type Mismatch each time. The only thing that worked was LongPtr.

  2. #17
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Try this:

    Dim i As Long

    RptRec.MoveFirst
    For i = 0 To RptRec.RecordCount - 1
    If RptRec("Quarter") = Qtr And RptRec("Provider_Id") = CLng(provider_ID) Then

    BTW why are you using ADODB?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #18
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Adodb?

    I hate to go on about this, but this line fails every time.

    Click image for larger version. 

Name:	Type Mismatch.PNG 
Views:	21 
Size:	19.2 KB 
ID:	40692

    BTW why are you using ADODB?
    This is old code that I didn't write?
    Attached Thumbnails Attached Thumbnails Type Mismatch.PNG   Type Mismatch.PNG   Type Mismatch.PNG  

  4. #19
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Funny, I saw that right in the beginning and didn't like it, but since the thread went the way of API's and such (and I had nothing to offer) I figured it wasn't an issue. I would have wrote it as To (rptRec.RecordCount -1) or (rptRec.RecordCount) -1
    but I'd also be concerned that you don't seem to be allowing for the possibility that the count is zero. Did you verify that by stepping through that procedcure? Also, by not moving last (getting the count) before moving first, the expression would be 1-1 = 0
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #20
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Micron may well be correct or try For I=1 To RptRec.RecordCount

    Can you confirm that you do have a reference for ADO.

    BTW I wrote CLng. CLong doesn't exist and will error
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #21
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I noticed that Micron, but till this upgrade it never came up. This code was written long before I came on board. I only fix things that are broke and this never attracted my attention.

  7. #22
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    This could have turned out better. I thought I had it licked when my accdb compiled and worked with both 32 bit and 64 bit Access, but not so fast. When I made the ACCDE using the 32bit machine it would only work with 32 bit Access. The same with 64 bit, so I am unable to make an ACCDE that works on both version. I went ahead and distributed the ACCDB so the users would be able get their work done, but I don't like this solution. There must be a way of doing this, but I don't know what it is.

  8. #23
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That's normal. I develop in 32bit, compile a 32bit accde. I copy the accdb to a 64bit machine and compile a 64bit accde there. I end up with 2 accde files, my version control utility knows which to grab.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #24
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    The point of this exercise was to have one version that would work for both. My thinking was that if the ACCDB worked for both, that the ACCDE would as well, but that is not the case. No time now to set up a version control installation. Maybe I can address that later.

  10. #25
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    More info here:

    https://www.devhut.net/2017/04/13/ac...compatibility/

    and also confirms that accde files must be compiled on the target version. As far as I know, if you run accde files in a mixed environment you need 2 files.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 02-05-2018, 08:14 PM
  2. Replies: 2
    Last Post: 02-01-2018, 08:39 AM
  3. Open older version of database
    By NISMOJim in forum Access
    Replies: 3
    Last Post: 05-30-2015, 03:23 PM
  4. Replies: 2
    Last Post: 04-17-2013, 08:53 PM
  5. Replies: 2
    Last Post: 03-14-2013, 04:43 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