Alpha Video Training
Results 1 to 8 of 8

Thread: Synchronize w/ 2nd form

  1. #1
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Synchronize w/ 2nd form

    I don't find a code snippet for this simple case since I am usually going between diffreent tables. I need code on a button to open a 2nd form from the current table, and synchronize to the record on the current form.

    This is easy if I code in the table name, but I want it generic, without a hard coded reference to a table name. Can't use Query() generated by the button genie since all records must show. #2 is where I need help
    1. get form pointer for new form that is loaded.
    2. fetch_goto() the recno that is same as current form

    the command would be
    f:Tables:my_table_name.fetch_goto(my_var)

    But I don't want to hard code "my_table_name". Working with xbasic explorer,I have not come up with the right syntax that generalizes this command. It will only be used on tables, not sets, so there will be only 1 table for the form.

    Bill.

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

    Default RE: Synchronize w/ 2nd form

    Bill, have you considered adding the other fields to your present form and hiding them while working with the first 'view'... then hiding the first group of fields and showing the second, at the press of a button when you want the 'view' to change. This would save opening a second instance of your table and you wouldn't need to synchronize two forms.

    While not well known it's easy to position fields right on top of each other. Hide one, show two. Then hide two, show one.

    -- tom

  3. #3
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default RE: Synchronize w/ 2nd form

    Problem solved. Use
    f:Tables.child(1).fetch_goto(vRecnum)

    Bill.

  4. #4
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default RE: Synchronize w/ 2nd form

    Tom,

    This a huge table (800 fields), so maintainability in separate forms is very important.

    Bill.

  5. #5
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default RE: Synchronize w/ 2nd form

    Bill,

    That's probably the wrong technique to use. The child(1)is the last link of a table. If anything, you want to reference from the 1st table (the parent) which is the last child(n) where n can be gotten from the children() method. So it would be something like child(children()-constant). But assuming you always want that table independent of where it is in the parent, then easiest way is to create an object like (I haven't checked the syntax)

    formname=table.current().name_get()
    tbl=obj(formname+":Tables:"+my_table_name)
    tbl.fetch_goto(my_var)

    Regards,

    Ira J. Perlow
    Computer Systems Design & Associates
    csda@mediaone.net

  6. #6
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default RE: Synchronize w/ 2nd form

    Ira,

    I had never investigated to see that the parent was always in the child(children()) position. That is good info. This technique will be for multiple forms on the same flat table, so children()=1. To always apply to the parent table if it were a set, command could be
    f:Tables.child(children()).fetch_goto(vRecno).

    The reason I wanted to do it this way is that code does not change when it is used for dofferent forms/tables (as long as it is parent). So you can use button genie to open the form and paste in the standard synchronization code which does not need to know a table or form name.

    If the 2nd form is on a _different_ table, then a query technique must be used. That is what I normally do, and it needs to be customized for each situation. I far prefer having standard code I can paste in.

    Bill.

  7. #7
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,957

    Default RE: Synchronize w/ 2nd form

    Bill,

    when you have the same record viewed on different forms, presumably, with an 800 field record, so that you could give the user access to different groups of fields depending on what they are doing, and the user is changing data on the same record on these different forms, - when the user leaves, and I guess closes a form, to go to another one, do you exit the form without "saving the record", or does it make any difference - what I'm wondering is how you can do this. I really like the idea - since a lot of editing I do is on a single table.

  8. #8
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default RE: Synchronize w/ 2nd form

    A record can have only one data entry processing going against it at a time. If another form, script, etc. tries to change the record, it is told the record is locked. So having multiple forms does not change that restriction.

    In my case, data entry is done on one form (with 15 tabs) and other forms display the data with different calculations, groupings, etc.

    Bill.

Similar Threads

  1. Synchronize Alpha & Outlook
    By Keith Hubert in forum Alpha Five Version 6
    Replies: 6
    Last Post: 06-20-2005, 03:55 PM
  2. Network Time Synchronize Freeware
    By russ Boehle in forum Alpha Five Version 6
    Replies: 17
    Last Post: 01-06-2005, 04:57 AM
  3. Form, Embedded browse and find by form problem
    By kim hansen in forum Alpha Five Version 5
    Replies: 3
    Last Post: 03-27-2003, 10:43 PM
  4. Newbie - Open 2nd form form 1st form w/record
    By Ron Schwartz in forum Alpha Five Version 5
    Replies: 2
    Last Post: 01-24-2003, 08:46 AM
  5. synchronize data
    By aaron nash in forum Alpha Five Version 5
    Replies: 3
    Last Post: 01-19-2003, 06:21 AM

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
  •