>Hopefully this is an easy question, but it seems to be eluding me...
>
>I have a table on the main form.  I use FrmPopupForm() to open a form to =
>gather data for a new table item.  After the new item is added to the =
>database, the form returns with FrmReturnToForm(0), but the table is not =
>redrawn.  I have redraw code in the frmUpdateEvent, but this is not being =
>called.

What version of the OS are you running? Debug or release ROMs?

If the pop-up form you're displaying isn't modal, and you're running 
on release ROMs, and the OS version is > 3.5 (or maybe 4.0?) then the 
OS doesn't erase your original form, so you don't get an update event.

At 12:02am -0700 02-07-25, Palm Developer Forum digest wrote:
>A broad way to do it is
>
>FrmReturnToForm(0);
>FrmUpdateForm(0, 0);
>
>This is only good if you don't mind updating your entire form. And you don't
>have to remember any names or IDs. FrmReturnToForm is documented to set the
>active form to its argument and accept 0 to mean "last loaded" form. Even
>though FrmUpdateForm isn't documented to take 0 for a formID and infer
>"current form", it works.

Relying on undocumented behavior is often a bad idea. In this case, 
what happens is that a frmUpdate event gets queued with the form id 
set to zero. If your update code doesn't bother checking this field, 
and assumes that the active form is the form that needs to be 
updated, then you get the desired result. It's not hard to envision a 
future where events with bogus data will trigger warnings or errors, 
at least on debug ROMs, so it would be better to use the real form 
id, even if that takes more programming effort.

-- Ken
-- 
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to