• Control Source (Access 2002)

    Author
    Topic
    #363288

    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

    Viewing 0 reply threads
    Author
    Replies
    • #554009

      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%?

      • #554011

        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

        • #554012

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

          • #554014

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

            • #554032

              Have you tried this?

              =DLookUp(“Both”,”qryBOTH”)/2

            • #554033

              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

            • #554035

              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.

            • #554039

              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

    Viewing 0 reply threads
    Reply To: Control Source (Access 2002)

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

    Your information: