Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unbound control display (2002)

    Hello All,
    I have a form (continuous forms display) with an unbound control. I want to change what the unbound control displays depending on what is in another field. How can I make the control display different text? For instance, I have a field called field_disposition. This field has data stored as a number like 0,1,2,3. Depending on that number I want the unbound control to display some text like "installed", "returned","Retained",etc.

    So far everything I have tried only changes all of the controls to the same text no matter what the disposition field has for a value.

    Thanks,
    Mark

  2. #2
    New Lounger
    Join Date
    Jan 2004
    Location
    Eastbourne, Sussex, England
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Unbound control display (2002)

    Set ControlSource for unbound control to something like:
    =Switch([field_disposition]=0, "installed", [field_disposition]=1, "returned", [field_disposition] =2, "retained")

    Regards
    Martin

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

    Re: Unbound control display (2002)

    This is the nature of unbound controls on a continuous form. There is only one set of controls, no matter how many records you see, and an unbound control can only get it's information from the current record. You would be better off using a query behind your form and including a calculated field that reflects the value based on another field. Then you can bind a textbox to that calculated field on the form and it will accurately reflect the value you want to see of each record. The Switch() function can be used in a query as well as in a controlsource, but you might find Choose simpler. Your calculated field would look something like this:

    Choose([field_Disposition] + 1, "Installed", "Returned", "Retained", ...)

    Choose uses indexes starting at one, so if your lowest value is zero, you have add one to it. Choose returns the indexed item from the list.
    Charlotte

Posting Permissions

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