Have you tried opening the second form by passing a reference object to it 
which points to the calling form. 

i.e from Form1 issue the following "do Form2 with Thisform"

In the Init of the second form do this:

* Procedure init()
Parameters toCalling_Form

Thisform.AddProperty("oCalling_Form", null)

Thisform.oCalling_Form = toCalling_Form
....

You can now use the Thisform.oCalling_Form object to call any events/procedures 
on the first form from the second.

Once you have added all the records you require in the second form you and 
issue an Thisform.oCallingform.<<Listbox>>.Requery immediately before the 
Thisform.Release which should display the added records on the first form.

Dave


-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Joe Yoder
Sent: 23 August 2016 15:06
To: [email protected]
Subject: Updating a listbox

I have a form that displays records from a table in a listbox.  A "New"
button adds a record to the table and calls a detail form that allows entering 
data to the blank record.  When the detail form closes I want the listbox on 
the original form to display the new record.

Its not working.automatically.  A mouse click anywhere on the list box causes 
it to resize and display the new record. I looked for a way to programatically 
simulate the physical mouse click but so far haven't found one. Here is the 
code in the button click event:
GOTO bottom
APPEND blank
thisform.list1.refresh
DO FORM PMdetail
thisform.list1.refresh
thisform.UpdateTot  && Update the total and refresh the form 
thisform.list1.click

I know there are better approaches but it seems this should work. Any ideas?

TIA - Joe


--- StripMime Report -- processed MIME parts --- multipart/alternative
  text/plain (text body -- kept)
  text/html
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to