Alpha Video Training
Results 1 to 5 of 5

Thread: Single Record update Operation Changes the display record to another record.

  1. #1
    Member
    Real Name
    Jim Curtis
    Join Date
    Mar 2015
    Location
    Syracuse New York
    Posts
    29

    Default Single Record update Operation Changes the display record to another record.

    I have a desktop application that updates the current record display on a form with data from another table activated by a button on the form.
    The update operation uses a saved update operation using the current record only for the update.
    The update operation itself works correctly except at the end of the internal function when it refreshes the display.
    This changes the current record.

    In debug the correct record is present at the start of the update operation and only changes after the refresh call.

    As a work around I have tried the record navigation goto record with a saved variable and it never ever returns back to my original saved record even though the goto record function in debug displays the correct record number in the call.

    Any help would be appreciated.
    Jim

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Single Record update Operation Changes the display record to another record.

    An update operation would not generally be the best choice to do what you describe. Operations are normally performed on a batch of records as opposed to single records.

    It should be fairly simple to assist you with a small script to make changes to the current record based on data from the external table.

    A few necessary details such as the name of the external table, the field names in that table containing values to be retrieved, the field names in both tables containing the linking information as to which record in the external table to use, etc will be helpful.
    There can be only one.

  3. #3
    Member
    Real Name
    Jim Curtis
    Join Date
    Mar 2015
    Location
    Syracuse New York
    Posts
    29

    Default Re: Single Record update Operation Changes the display record to another record.

    I have a database used to keep track of parts being built. We have both open and finished Parts in this database. Some of this data consists of time estimates and actual times to build these parts. On a newly entered part build we want to create an estimate on how long it may take to build this style of part by the previous ones build to help gauge our costs.
    So I have created on button on a form to just that.
    In The Button
    We create variables for the part displayed and the current record number.
    We then check to see if we have other records like the current part with data in these fields.
    Using tablecount() - This works fine as long as I don't try to exclude the current record in the filter
    with: '.and. (recno() <> var->saved_recno) The (var->current_part = part_no) .and. (has data criteria > 0) works fine.
    if my count is more than 2 I have at least 1 record that I can use for my estimates calculator.
    I then call a save operation to do the counts and sums on the bottom 5 records of this filter criteria.
    I then open a browse on this table to update the default record index for my lookups.
    I close the browse.
    I now try to use a records - Xbasic record change - action in the button code editor.
    I use recno() for the record to update.
    Specify 13 fields to be updated with expressions. Which during debug work fine, the error occurs when doing the tbl.close(.t.) call. An error is generated with a bogus index claimed as not an open index.

    Jim

  4. #4
    Member
    Real Name
    Jim Curtis
    Join Date
    Mar 2015
    Location
    Syracuse New York
    Posts
    29

    Default Re: Single Record update Operation Changes the display record to another record.

    Additional info the bogus index is not used or required by the data or summation file.
    Jim

  5. #5
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Single Record update Operation Changes the display record to another record.

    Which table are you trying to close with tbl.close(). If it is the table upon which your form is based, you can't close it. The form has it open.
    There can be only one.

Similar Threads

  1. How to link single record in report to single record in grid
    By lfagerman in forum Alpha Five Version 10 - Desktop Applications
    Replies: 2
    Last Post: 08-19-2010, 09:55 PM
  2. How to link single record in report to single record in grid
    By lfagerman in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 08-18-2010, 12:18 PM
  3. newbieQ: print single record or current record
    By dlazenby in forum Alpha Five Version 9 - Desktop Applications
    Replies: 1
    Last Post: 07-14-2008, 04:11 AM
  4. update a single record
    By andymeer@yahoo.co.uk in forum Alpha Five Version 7
    Replies: 16
    Last Post: 10-09-2006, 08:38 PM
  5. Update Operation Not Using Current Record
    By Jonathan Short in forum Alpha Five Version 5
    Replies: 3
    Last Post: 08-11-2004, 02:59 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
  •