Results 1 to 4 of 4
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ADO Recordset Find Method Behaviour (2003)

    rst.EOF is False when I try it. <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ADO Recordset Find Method Behaviour (2003)

    If I put a breakpoint before the code line
    <font color=red> rst.Find ("Giorno=#" & Format(Forms!Prev!CGior, "mm/dd/yyyy") & "# ") </font color=red>
    in the Private Sub Comando255_Click()
    of the attached mdb, select March 8, 2006 on the calendar and then click the Agenda button on the startup form, I can see that the conditional statement
    <font color=448800> If rst.EOF Then </font color=448800>
    returns True
    How's that possible since the Varie table already contains the March 8, 2006 date?

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ADO Recordset Find Method Behaviour (2003)

    There is something going on here that I had never noticed before (I still mostly use DAO). When I tried your code before, I was on a system with US date format, and rst.EOF was False. I now tried on a system with continental European date format , and rst.EOF was True.

    Apparently, ADO interprets a date in the criteria argument of rst.Find according to the local system settings. This is different from VBA, SQL and DAO - they all ignore local settings in favour of US settings.

    So the rst.Find line must be

    rst.Find "Giorno=#" & Me!CGior & "#"

    But the CommandText a few lines down is handled by SQL, so there the date must still be converted to US format, otherwise 8 March will end up in the table as 3 August! <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ADO Recordset Find Method Behaviour (2003)

    Thank you for your keenness Hans, evidently ADO has a more worldwide scope.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •