• Default Values Dropping (2000)

    Author
    Topic
    #369847

    Can anybody shed any light as to why a currency field with a default value set at 0 at table level and in the field’s properties on a related form should “drop”? I have a database which sometimes reads this default and sometimes doesn’t! Any help appreciated

    Viewing 1 reply thread
    Author
    Replies
    • #583413

      What do you mean by “drop”? And when you say “I have a database which sometimes reads this default and sometimes doesn’t”, it almost sounds like you are talking about another database.

      • #583533

        Dear Mark – I mean sometimes the default value is shown, ie

        • #583542

          If the DefaultValue in the table is 0, then new records should have a 0 in that field if created via an append query (or code) and if no specific field value is assigned. The DefaultValue of a form’s control supersedes the table’s DefaultValue when creating new records.

          I’d look at those records that show Null, and try to determine how they got added, and see if there is any consistency.

          • #583557

            Mark (et al), thank you very much – I have fixed this – new records are defaulting correctly, old records
            were added by an append – I have now updated, and all is running smoothly.

            What a way to spend a Saturday afternoon! Have a good one.

    • #583416

      The only thing that comes to mind is that a default only works for new records. It doesn’t have any effect on existing records, even if the field in question is blank.

      • #583481

        Plus, if you append a Null to that field in a new record, you get a Null, not the default.

        • #583535

          Not sure if I know what you mean Charlotte – shouldn’t all new records automatically take the default?

          • #583572

            If your query appends a Null to the field, then you will get a Null, not a default value. That is the in the nature of append queries and bites a lot of people who expect the default value to override it.

      • #583534

        That may be possible, Douglas – can you explain to me why that might be the case? Thanks

    Viewing 1 reply thread
    Reply To: Default Values Dropping (2000)

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

    Your information: