Alpha Video Training
Results 1 to 5 of 5

Thread: How do I update a variable which is a count of records on a form embedded browse?

  1. #1
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    732

    Default How do I update a variable which is a count of records on a form embedded browse?

    The following code loads and shows a form, the global value vMissingFileCount is also dimmed as a global variable on the 'OnFetch' event for the Form.

    Code:
    dim global vMissingFileCount as n
    .
    .
    .
    .
    .
    
    frm = :form.load("EnterRegMissingForm","dialog")
    vMissingFileCount = frm.records_get()
    frm.show()
    frm.close()
    How do I get the vMissingFileCount variable to decrease/increase whilst editing data on the embedded browse (ie Delete/Add Records) and show correct total?
    Last edited by Graham Wickens; 02-20-2019 at 02:49 PM. Reason: Clarity
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  2. #2
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,271

    Default Re: How do I update a variable which is a count of records on a form embedded browse?

    Is the data on the Form the result of a Filter, or is it a count of all records in the Table?

    In either event, OnChange or OnSave could be used to rerun the query.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  3. #3
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,584

    Default Re: How do I update a variable which is a count of records on a form embedded browse?

    If the variable is placed on the form, try refreshing the object name in the OnFetch event. Other than that tablecount might work better than records_get.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  4. #4
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,271

    Default Re: How do I update a variable which is a count of records on a form embedded browse?

    Don't know whether this helps or hinders, but it is an option.
    example.zip
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  5. #5
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    732

    Default Re: How do I update a variable which is a count of records on a form embedded browse?

    Thanks Guys,

    by trial-and-error, I got it to work by setting my variable to tablecount("tablename",".t.") on the OnFetch event on the embedded table.
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

Similar Threads

  1. update embedded browse in a form
    By jackswift in forum Alpha Five Version 10 - Desktop Applications
    Replies: 4
    Last Post: 05-12-2010, 06:50 PM
  2. Update embedded browse field from called form
    By enstorms in forum Alpha Five Version 9 - Desktop Applications
    Replies: 7
    Last Post: 09-25-2008, 04:03 PM
  3. How to open a form with embedded browse even if there is no records in the browse?
    By georgefurnel in forum Alpha Five Version 9 - Desktop Applications
    Replies: 9
    Last Post: 05-23-2008, 09:15 AM
  4. Append Records but Embedded Browse Does not Update
    By davenfla in forum Alpha Five Version 8
    Replies: 2
    Last Post: 01-13-2008, 03:22 PM
  5. Embedded Browse on Form won't update correctly
    By brett s in forum Alpha Five Version 7
    Replies: 13
    Last Post: 08-02-2006, 09:40 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
  •