Alpha Video Training
Results 1 to 7 of 7

Thread: What am I doing wrong

  1. #1
    Member
    Real Name
    Alex Muir
    Join Date
    Nov 2000
    Location
    Stocksfield UK
    Posts
    443

    Default What am I doing wrong

    Having now made the decision to move over to Alpha5V4 from A4v6, I have hit a brick wall.

    In A4v6 to get a child database field to be the same as the corresponding parent, you went to field rules and made the child a calculated field saying it equalled that field in the parent.

    Try as I may I cannot see how A5V4 lets me do this. If I try to do the same (set field rules) as A4V6, I only see the child table.

    It will be something simple of that I am sure.

    Can anyone help?

    Thanks

  2. #2
    "Certified" Alphaholic
    Real Name
    Ohlen Cartmell
    Join Date
    Apr 2000
    Posts
    1,599

    Default RE: What am I doing wrong

    In A5 you use a lookup expression in a the field rule for a calculated field. You can use the lookupn, lookupc, lookupd, etc depending on whether the value is numeric, character, or date.

  3. #3
    Member
    Real Name
    Alex Muir
    Join Date
    Nov 2000
    Location
    Stocksfield UK
    Posts
    443

    Default RE: What am I doing wrong

    Right I tried that.

    Dear o dear o dear, and I thought Alpha5 was supposed to be the easy to use relational database!

    Have you read the help page on each of the lookup functions.
    Surely its got to be easier than this?

    Some of us aren't programmers. We just want to get there as simply and as easily as possible.

    So in simple terms I have an A5V4 set and I want to make a field in the child database = a field in the parent.

    The child field = customer
    The parent field = prospect
    The index is called DOCNO
    What's the expression?

    My, I can hardly wait to begin the Xbasic tutorial. I bet that's easy!
    If I wanted to feel confused, inadequate, and depressed... I would have bought Access!!!

    Thanks for your patience.

  4. #4
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: What am I doing wrong

    Alex:

    This will be easier in A5 version 5, along the lines of Alpha4. Even so, it is not as bad as it looks.

    You don't mention the names of your tables so I will call them parent.dbf and child.dbf. You put in the real names.

    What I think you want to do is set up a calculated field rule in the parent table which stuffs the value of the customer field in the child table in to the prospect field of the parent table. If I am wrong, say so.

    You wrote:
    The child field = customer
    The parent field = prospect
    The index is called DOCNO
    What's the expression?

    I think something is missing: the name of the linking field between parent and child. If we have that we can insert it in the lookup expression to find the right child record and lookup the value of customer.

    The following should be inserted in the space for the calculated field rule expression in the prospect field of parent.dbf:

    lookupc("f",linkfield_no_quotes,"customer","child.dbf","docno")

    I am sorry I cannot test this for you but I think it is correct. It is certainly *almost* correct but, as you know, almost gathers no bouquets.

    Good luck,
    Bill

  5. #5
    "Certified" Alphaholic
    Real Name
    Ohlen Cartmell
    Join Date
    Apr 2000
    Posts
    1,599

    Default RE: What am I doing wrong

    Hi Bill,
    You're, of course, correct but he wants to go the other way - bring the parent field into the child so it would be:

    lookupc("f",linkfield_no_quotes,"prospect","parent.dbf","docno")

    and the expression would be placed in the field rules of a calculated field in the child table.

  6. #6
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: What am I doing wrong

    Whoops; quite so.

    Thanks Ohlen,
    Bill

  7. #7
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default RE: What am I doing wrong

    Alex, I prefer to handle this at the form level, instead of in field rules of the child table.


    Assume the existence of a form based on your 'parent' table. If you wanted to add a transaction for that 'parent' you could have a button on the form to open a second form, based on the child table. The script that opens the child table form could stuff values from the parent form into global variables.

    On the child side, when the child table form opens, the onInit or OnActivate events for the form could contain a script which declares an identical set of global variables. These variables can then be 'stuffed' into fields on the form as it is first displayed on screen.


    The effect of this is to 'pass' the values from the parent table form to the child table form, using global variables.


    Later on, when you have more experience with Alpha Five, you will learn that it's possible to read values directly from the parent table form, from the child table form, without using global variables, so long as both forms are open in memory at the same time.


    BTW, I encourage you to visit the Alpha Five vers. 4 message forum. This forum is intended, I believe, for product announcements, not for troubleshooting user databases... You're message threads will have a wider audience if you post them in the vers. 4 forum.


    -- tom





Similar Threads

  1. So...what's wrong with this?
    By GregOnline in forum Alpha Five Version 5
    Replies: 3
    Last Post: 10-07-2003, 02:34 PM
  2. What is wrong with th is?????
    By Schulzie in forum Alpha Five Version 4
    Replies: 7
    Last Post: 09-18-2003, 01:29 PM
  3. WHAT am I doing Wrong?
    By Ronald Anusiewicz in forum Alpha Five Version 5
    Replies: 1
    Last Post: 05-09-2003, 09:16 PM
  4. What is Wrong Here?
    By Peter DeBilio in forum Alpha Five Version 5
    Replies: 1
    Last Post: 02-06-2003, 03:24 PM
  5. what am i doing wrong?
    By Edward F. Schulz in forum Alpha Five Version 4
    Replies: 4
    Last Post: 04-01-2002, 02:13 PM

Bookmarks

Posting Permissions

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