Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's something in the attached mdb that I think should obviously work but doesn't: when a text box AfterUpdate event fires, shouldn't the data inputted in the text box already be saved in the relevant table?
    On the startup form, please select 25th October 2009, then, for the bottom row where Ora=24, input 1000 in the Testo179 text box(that's the seventh column in the subform, say Yes to the dialog box that pops up).
    Why, in Private Sub Testo179_AfterUpdate(), does
    a = DCount("*", "previsioni", "Giorno=#" & Format([GIORNO], "mm/dd/yyyy") & "# " & _
    "and [g2car] is null")
    give you a=1 while it should be a=0?
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    When the AfterUpdate event of a control occurs, the record as a whole has not been saved yet - the value has been updated in memory, not on disk. DCount looks at the records on disk, so it doesn't "see" the updated value until the record has been saved.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Hans :-)

Posting Permissions

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