Results 1 to 15 of 15
  1. #1
    Join Date
    Sep 2013
    Posts
    12

    Unanswered: Populating fields

    Hello guys!
    I'm quite new at BDB and don't know how to resolve this...

    Let's say that I have one form with fileds: NAME, NUMBER1, NUMBER2, NUMBER3.

    Let's say that I have another form with dropdown menu field. In dropdown menu I'm using all NAME records which are entered in previous field. In this form I have also field NUMBER2.

    Here's the question: how can I automatically populate field NUMBER2 with value entered in the first form? NUMBER2 must depend regarding selecting record from dropdown menu which has field NAME.

    If there is some kind of script or something similar, newbie example is very much appreciated

    Thanks in advance.

  2. #2
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hello.
    Please see attached file for a working example of what you are asking.

    All the names in the drop down list are pulled from the contacts folder. When you select a name from the drop down list, the number field will update exactly as you requested.

    Kind regards
    James.
    Attached Files Attached Files

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Great zot Tubritt! What are you doing up posting on DBForums at that hour of the day (night) ???

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  4. #4
    Join Date
    Sep 2013
    Posts
    12
    Thank you very much for your help!

  5. #5
    Join Date
    Sep 2013
    Posts
    12
    I do have one question.
    What means "[%queMathOp(1000,5,12,6)]" in the script?
    What this numbers mean?

    In help file I've found: "queMathOp (QueryID, FormID, |Field|, |Operation|, Var1, Var2) - records are generated on the basis of the query with QueryID. You can use the optional variables Var1 and Var2 to set the User Input query parameters."

    But I don't know how to adjust these numbers for my case. Where can I see QueryID and FormID? Can you please, explain each number?

    Actually I have a case where I have to populate two fileds based on drop down selection. I guess I have to put one more line of code in the script with queMathOp...but first I have to understand how queMathOp works.

    Thx in advance
    Last edited by okicizepa; 01-12-14 at 08:26.

  6. #6
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Quote Originally Posted by Pat Phelan View Post
    Great zot Tubritt! What are you doing up posting on DBForums at that hour of the day (night) ???

    -PatP
    lol... Wow that was late.

    James

  7. #7
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    I do have one question.
    What means "[%queMathOp(1000,5,12,6)]" in the script?
    It means this....
    queMathOp(|Name Search|,|Contact|,|Number|,|First|)

    queMathOp = An operation with data from a Query
    Name Search = This is the name of the Query we will be working with.
    Contact = This is the name of the form you want to pull a value from.
    Number = The name of the field you want to pull a vale from.
    First = This means that the first record that matches the query result will be used.

    When I enter in all that, brilliant database transforms it into [%queMathOp(1000,5,12,6)] which is just a short code for what I entered.

    Tell you what... have a look at thee attached FLASH / HTML animation. I will delete line 3 and recreate it to show you how it's done.

    Kind regards
    James
    Attached Files Attached Files

  8. #8
    Join Date
    Jan 2014
    Posts
    18
    Hi,
    The attached example is alternative way to complete the task. I've used Jame's DB to show how to use relational field and relational lookup field.

    This way may be more convenient if you have a lot of contact (50 or 100+) as you can search the contact and enter the necessary one in Drop Down form.
    Attached Files Attached Files

  9. #9
    Join Date
    Sep 2013
    Posts
    12
    Now I understand!

    Thank you very much!


  10. #10
    Join Date
    Oct 2013
    Location
    Philippines
    Posts
    103
    Wow. Good good job James.

  11. #11
    Join Date
    Jan 2014
    Posts
    18

    Alternative way

    Hello,

    This is alternative way to achieve the task. I've used Jame's database and added example of using relational field and value lookup for relational field.

    This approach does the same as Jame's example, but may be more convenient if you have a lots of contacts as you are able to search between contacts and choose the one you need.

    Best regards,
    Attached Files Attached Files

  12. #12
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    It's just one of many ways to do it.

    To be honest, I wouldn't use the drop down list approach at all when dealing with peoples names. If it were my database, I'd use a “simple relation field” instead of the drop down list.

    The problem with drop down lists when dealing with peoples names is that you will most certainly run into trouble when two people who have the same name are added to the database.

    Soon as that happens, there's a 100% certainly that the database will pull the wrong number of one of the two people. It will prefer the first person of the same name over the second.

    Regards
    James

  13. #13
    Join Date
    Oct 2013
    Location
    Philippines
    Posts
    103
    Quote Originally Posted by rimpet789 View Post
    Hi,
    The attached example is alternative way to complete the task. I've used Jame's DB to show how to use relational field and relational lookup field.

    This way may be more convenient if you have a lot of contact (50 or 100+) as you can search the contact and enter the necessary one in Drop Down form.
    Yes, this is the "simple relation field" James was referring to.

  14. #14
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Very strange.
    When I posted my last post the one above it wasn't there. I didn't even see the file rimpet posted.

    Oh well.

    Happy endings all round.

    Regards
    James

  15. #15
    Join Date
    Jan 2014
    Posts
    18
    My post appeared only after I contacted Pat, but the timestamp had the original posting time - not the time they actually showed up on the forum.
    They were marked as "suspicious" for some reason and got delayed...

Posting Permissions

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