Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2005
    Posts
    21

    Question Unanswered: Form Default Value

    Can I have a form text box default value be the value from another text box plus a number?

    IE: text1 is 830 and I'd like the default for text2 to be 830.25

    ---

    Ok, let me tell you what I am after.

    Time tracking

    Start an activity at a certain time, if it ends at the same time I'd like the default value to be 1/4 of a minute. Or .25.
    Last edited by davenportjacque; 11-13-05 at 16:19.

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Quote Originally Posted by davenportjacque
    Can I have a form text box default value be the value from another text box plus a number?

    IE: text1 is 830 and I'd like the default for text2 to be 830.25
    Sure...If the text2 the same form as text1 then you would place this into the Default Value property:

    =[text1]+0.25

    If text2 is located on another form then you would place this into the Default Value property:

    =Forms![myText1FormName].[text1]+0.25
    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    And for generating a new invoice number (and the field is NOT an autonumber field) I've even put something like this into the InvNum control's DefaultValue property:

    =Nz(DMax("[InvNum]","tblInv"))+1
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  4. #4
    Join Date
    Sep 2005
    Posts
    21

    Not Working

    Is there any reason at all why it wouldn't work? I've tried both suggestions, but it won't place that default value in the form.

    I'd even settle to have it place the same value as text1 in it. But can't get that work work either.
    Last edited by davenportjacque; 11-14-05 at 22:05. Reason: More to say...

  5. #5
    Join Date
    Sep 2005
    Posts
    21

    Thumbs up Got it!

    I didn't mention that I have a 3rd calculated field. I put the following in that field.

    =[text2]-[text1]+0.15

  6. #6
    Join Date
    Sep 2005
    Posts
    21
    Buuuuut....How can I get text2's default value to be the same as text1?

  7. #7
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    That makes no sense. You have a field with "=[text2] - [text1] + .15" and now you want to set text2 to be the same value as text1? What are you doing?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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