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

    TextBox Doesn't Retain its Default Value (2003)

    On the startup form of the attached mdb, I've set the default value of the textbox labelled "Flow (l/s)" to 500 so I was expecting this default value to be retained once I create a new record.
    The calendar on the startup form opens up on 1st September 2006, so I type, e.g., 1726 in the textbox labelled "Reading", close the form, reopen it and select 1st September 2006 on the calendar but the textbox labelled "Flow (l/s)" hasn't retained the default value. Can anyone figure out why?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: TextBox Doesn't Retain its Default Value (2003)

    When you say that you type into the text box Reading. This text box is on the subform right?

    I have done as you described and i get 500 staying in that box ok.

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

    Re: TextBox Doesn't Retain its Default Value (2003)

    Hi Pat, thank you. Yes, the textbox labelled "Reading" is on the subform.
    Does the textbox labelled "Flow (l/s)" retain 500 if you close the main form and reopen it and select 1st September 2006 on the calendar?

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: TextBox Doesn't Retain its Default Value (2003)

    Yes mine does

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: TextBox Doesn't Retain its Default Value (2003

    How do you create new records?
    The reason I can't keep the 500 is that I cannot create records.
    What are you supposed to do?
    Regards
    John



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

    Re: TextBox Doesn't Retain its Default Value (2003

    Hi John, you have to input a value in any of the textboxes in the subform. In the opening post, I suggested typing, e.g., 1726 in the textbox labelled "Reading".

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

    Re: TextBox Doesn't Retain its Default Value (2003)

    When you close and reopen the main form, what date does the textbox labelled "First day yet to be filled" display?

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: TextBox Doesn't Retain its Default Value (2003

    When I do that I get a new record in the PA table, but still no record in the PortOlm table.
    Regards
    John



  9. #9
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: TextBox Doesn't Retain its Default Value (2003

    Sorry, Yes it did create a new record. I don't know why I could not see it, and it had lost its 500.

    but If I put the default value as a default for the table, rather than just for the form, it seems to work OK.
    Regards
    John



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

    Re: TextBox Doesn't Retain its Default Value (2003

    You're right John, thank you <img src=/S/smile.gif border=0 alt=smile width=15 height=15>.
    Go figure why it doesn't work if you set it only for the form <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  11. #11
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: TextBox Doesn't Retain its Default Value (2003)

    The same date as the main form?

    Tell me, what is this form to be used for? You have a main form and a subform joined on Giorno ( a date that is a primary key in both tables). Why not have just the one table?

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

    Re: TextBox Doesn't Retain its Default Value (2003)

    That means you haven't created a new record, otherwise the textbox labelled "First day yet to be filled" would display 2nd September 2006.
    Don't worry Pat, John has found the solution. The mdb is a stripped down version of a larger database with many more Form/subform combinations that all reference the PortOlm table. Thank you Pat.

Posting Permissions

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