I call a function.  I am trying to update the fields on a form.  I have written 
a function to perform precisely that activity.  That form field fill function 
works marvelously when the form first loads.  It works when I return to the 
form after going to some other form.  It doesn't seem to work when I try to 
call it after it has already filled in the fields.  The form field filling 
function (say that ten times) is called TransformerFormFill.  The structure is 
getting the right data.  I tested it with a boolean statement.

The function code that exhibits a problem with form filling is:

if (eventP->data.ctlSelect.controlID == Find)
{
Err err=0;
Char Text[10];
Char Textdat[10];
UInt16 index;   
MemHandle h;
//Get pointer to field for search string
FieldType * field = (FieldType*)GetObjectPtr(GoToField);
err=0;
if (field)
{
err = GetFieldText(field, Text);
StrCopy((Char*)Textdat,(Char*)Text);
err = ClosestSort((Char*)Textdat, gTransformer);
//err = DmQuickSort(gTransformer,ClosestCompare, 0);
}
if(Tindex>=0)
{
myRecord = DmQueryRecord(gTransformer, Tindex);
if (!myRecord)
err = DmGetLastErr();
else
{
rec = (TransStruct*) MemHandleLock(myRecord);
MemHandleUnlock(myRecord);
}
if (err==0)
err = TransformerFormFill(rec);
}
if (rec->DegreeMatch==10)
{
FrmGotoForm(TransMore);
}
handled=true;
break;
}       

I have tried to redraw the form, but this doesn't seem to induce the desired 
behavior.  Once again, the form does load the correct data using the 
TransformerFormFill routine if I merely exit this form then return to it.

Thanks for any assistance with this.
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to