Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2

    Answered: Unable to Assign a Variable From the Value in a Drop-Down List

    I have added a drop-down list that is populated from the records in another folder - this works just as it is supposed to (the list appears and I can select from the values just fine). However, if I add a variable that is supposed to capture this field, it never recognizes that a value is present in the drop-down list. I have tried everything I know to do but I cannot successfully assign a variable to get the value in that field.

    This simple exercise was NOT was I was originally trying to do. Instead, I wanted to use the value in the drop-down list to filter a recordset but the values always remained the same regardless of what selection I made in the drop-down list. When I looked further (by adding a message box to show exactly what value was selected from the drop-down list), it came up blank EVERY time I ran it and BD cannot recognize any value in the drop-down list. It has been a while since I have done any scripting in BD but is there some quirky about using drop-down lists?
    Daryl G

  2. Best Answer
    Posted by Tubbritt

    "Hi Daryl.

    Does it make a difference if I have additional tabs on the folder
    No, that won't matter at all.

    I added an 'If' the variable is not equal to "" statement.
    Is your variable a Text variable or a Maths variable. If it's a Maths variable, then your IF statement may not work because a Maths variable that contains no value equals 0, not ""

    This really makes no sense to me but for some reason when I was setting up the 'If' statement, I had to remove the reference to the folder and instead use 'any record' and then pick the same variable. After making that change, the program actually recognized the variable and did what it was supposed to. Is this normal behavior if one references a global value
    That's certainly not normal. That should have made no difference whatsoever.

    Regards
    James."


  3. #2
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hi Daryl.
    See attached.

    Does that help?

    Regards
    James
    Attached Files Attached Files

  4. #3
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    James,
    Thanks. Your example works splendidly; however, I still have an issue on my project. Does it make a difference if I have additional tabs on the folder? The reason I am asking is that, as an experiment, I added an 'If' the variable is not equal to "" statement. It works fine on your example but mine still does not recognize that a selection was made (just like you, I included the 'On edit' execute script and assigned the variable). The only difference between your working model and my inoperable model is that I have an added tab where the drop-down box appears. I am curious if this is my problem because it still shows that no value from the list was selected.
    Daryl G

  5. #4
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    I did take a detailed second look and modified James' program and added a tab (sheet) to the form. Next, I replicated the drop-down box and button and it works perfectly. Whenever I do the identical operation within my program, it still refuses to recognize that a selection was made in the drop-down box.

    I think that I have the poorest track record of using Brilliant Database successfully... others seem to get this very quickly but I still have so many problems.

    Update... a few hours later and after testing all sorts of combinations I was finally able to get it to work. This really makes no sense to me but for some reason when I was setting up the 'If' statement, I had to remove the reference to the folder and instead use 'any record' and then pick the same variable. After making that change, the program actually recognized the variable and did what it was supposed to. Is this normal behavior if one references a global value (I do not recall ever having to do that previously)? Even in James' modified model, this activity was not required... I seem to always have problems???
    Last edited by fireant911; 07-04-15 at 19:24. Reason: update
    Daryl G

  6. #5
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hi Daryl.

    Does it make a difference if I have additional tabs on the folder
    No, that won't matter at all.

    I added an 'If' the variable is not equal to "" statement.
    Is your variable a Text variable or a Maths variable. If it's a Maths variable, then your IF statement may not work because a Maths variable that contains no value equals 0, not ""

    This really makes no sense to me but for some reason when I was setting up the 'If' statement, I had to remove the reference to the folder and instead use 'any record' and then pick the same variable. After making that change, the program actually recognized the variable and did what it was supposed to. Is this normal behavior if one references a global value
    That's certainly not normal. That should have made no difference whatsoever.

    Regards
    James.

Posting Permissions

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