Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Control Source (Access 2002)

    I have one unbound text box called BOTHPercent it displays information based on the control source =DLookUp("Both","qryBOTH"). That works correctly. Going to the second unbound textbox the control source reads =[BOTHPercent] which correctly returns the amount displayed in the BOTHPercent textbox. What I want to do is have the value in the second display box display one half of the value of the first textbox. So I entered =[BOTHPercent]/2 and I get the dreaded #Error message. I have fiddled with this and still can't get it to work properly. So what is the obvious answer? I know it has to be as clear as anything, but I can't see the answer. I have tried quotes and () without success.

    Thank you. Fay

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control Source (Access 2002)

    What happens if you directly type a value in to BOTHPercent?

    What values are you expecting from =DLookUp("Both","qryBOTH") could you be getting a text value? Something like 10%?

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control Source (Access 2002)

    That expression returns a value of 19.75%. I went back to the table that the data came from it was set as text data type. I changed it to Number, long int. But that did nothing to help.

    Thanks Fay

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control Source (Access 2002)

    And what happens if you directly type a value in to BOTHPercent?

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control Source (Access 2002)

    I typed =19.75 in the actual text box from BothPercent and it divided out equally. Go figure.
    Thanks for helping. Fay

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Control Source (Access 2002)

    Have you tried this?

    =DLookUp("Both","qryBOTH")/2
    Charlotte

  7. #7
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control Source (Access 2002)

    Yes I did and I just did it again and still get the error message. I have since gone back to the query and made an expression that will give me the half value. So my next problems is to add that to the value of another control and get a third figure in a third unbound textbox. I enter the following =[ADAMHSPercent]+DLookUp("BothHalf","qryBoth") and get 51.68%9.8%.

    I don't have a lot of experience but I am really baffled why this isn't working. Thanks Fay

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Control Source (Access 2002)

    Your expression is concatenating the results rather than adding them. That suggests that both values being returned are strings, possibly created using the Format function, rather than numeric values. What you need to do is have your calculations return a decimal value like .5168 and .098, add those two together and *then* apply the formatting, assuming that adding two different percentages together makes sense mathematically, that is.
    Charlotte

  9. #9
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control Source (Access 2002)

    I had formatting set in the field name of the queries. Corrected that and yahoo it is working correctly. You are a sweetheart with a great head. Thanks for peeking in on the tail end of a holiday weekend. I hope you had a great one. Thanks!!!!! Fay

Posting Permissions

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