Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2014
    Location
    UK
    Posts
    20

    Unanswered: Selecting and opening a record from a dropdown

    Hi

    Can anyone help me please?
    I have a form with a product field [ProductName] on it but there are lots of products in the folder to search through.

    I thought it would be easier if I used a drop-down list [ProductSearchName] to select the product I'm looking for and then go to that record automatically. I created a drop-down based on records from the folder and then executed a script on edit to select and move to the chosen record. I used "Select Record by Rule and then [ProductName] = [ProductSearchName] (Ive omitted the rest of the code generated in the Rule here).
    I then refreshed the Field [ProductName] but it doesn't work.

    I know I'm missing something here and its probably blindingly simple and stupid but can anyone help me please?

    Thanks as always

    Doug

  2. #2
    Join Date
    Apr 2013
    Posts
    226
    Hi,

    That works for me on testing. You do have to make sure you specify the correct folder where the record to be located is when defining the "Select Record by Rule". It needs to be the actual folder as far as I can tell, can't be a parent folder. My example was like this:

    Select Record By Rule (FOLDER_WITH_RECORDS, FORM_NAME And ([ProductName] = [ProductSearchName] of selected "FORM_WITH_DROP_DOWN"))

    Matty
    Last edited by matty1965; 04-06-14 at 21:14.

  3. #3
    Join Date
    Feb 2014
    Location
    UK
    Posts
    20

    Thank You

    Thanks Matty

    Ive got it now. It was the last part I was missing - either that or I did something else wrong when I was trying it.
    Ive noticed that the drop-down list sometimes retains the selected value of the previous search even although the correct record has been returned by the search but the next time, the drop-down goes blank when it finds the correct record and when I select the drop-down again, it defaults to the bottom position of a very long list.
    I tried refreshing both fields but it doesn't change anything. Any ideas?

    The main thing is that it now works so thank you for pointing me in the right direction.

    Doug

  4. #4
    Join Date
    Apr 2013
    Posts
    226
    Great it is now working.

    That behaviour seems to be a feature of drop down lists based on a folder. It always defaults to a blank item at the bottom of the list. That's why I've been trying to find a way of addressing the contents of that list so you could say select the first item or a specific item. But there doesn't seem to be a way.

    Matty

  5. #5
    Join Date
    Apr 2013
    Posts
    226
    For the first issue I would clear and then refresh the field at the end of the script. That may work.

  6. #6
    Join Date
    Feb 2014
    Location
    UK
    Posts
    20
    Hi Matty

    Ive tried refreshing just about everything I can think of but no luck. Ive tried using variables queries etc etc.
    I will keep looking and obviously, if I find anything, I will let you know.

    Once again thanks for helping me.

    Doug

  7. #7
    Join Date
    Feb 2014
    Location
    UK
    Posts
    20
    Hi Matty
    I found a work around for the drop-down list defaulting to the blank record at the bottom (I think).

    Its not very pretty but it is stupidly simple - I just set the drop down field value to equal the field value I just set using the drop-down - if that makes sense!!!

    In my case, I have a lot of entries at the bottom of the list that will either be deleted eventually or will seldom be used and it was a pain having to scroll back up through the list every time (Lazy I know).

    Anyway, we got there in the end. Thanks again.

Posting Permissions

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