• Updating a Text Box Underlying Field

    Author
    Topic
    #463888

    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?

    Viewing 0 reply threads
    Author
    Replies
    • #1185615

      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.

    Viewing 0 reply threads
    Reply To: Updating a Text Box Underlying Field

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: