Subject Re: field type binary not working on my form
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Sun, 17 Sep 2023 05:12:06 -0700
Newsgroups dbase.getting-started

On 9/17/2023 2:41 AM, Mervyn Bick wrote:
> On 2023/09/17 08:43, AGOSTINHO wrote:
>> Dear group,
>> I've made a small seek_fish.form I've applied Mervyn  advice but still
>> the same result.
>> when I scroll the grid the pictures display properly but as soon I
>> type any character in the search entryfield  I will not be able to see
>> the images anymore, the only thing I can  do is to  close the form
>> than it will reset.
>> Any help how to solve this problem.
>> In advance thank you very much
>> Agostinho
>>
> ......>
>>     function ENTRYFIELD1_onKey(nChar, nPosition,bShift,bControl)
>>         form.fish41.params['ag'] = '%'+this.value+'%'
>>       try
>>         form.fish41.requery()
>>      catch(exception e)
>>         form.fish41.requery()
>>     endtry
>>     return
>>        return
>
> The second return is not required but it doesn't seem to upset dBASE as
> removing it didn't change the way the form worked.
>
> You didn't include the fish4.dbt file but this was not a problem as I
> simply copied fish.dbf from the DBASESAMPLES folder to fish4.dbf in my
> working folder.
>
> I obviously had to change the path in the sql property of the query to
> suit my computer but your form ran as it stood.  Selecting records in
> the grid changed the image displayed as expected.  Typing values into
> the entryfield changed the rowset but, although the image didn't
> disappear, the image didn't change.  Once a new set of records had been
> displayed, selecting different records in the grid didn't change the image.
>
> Using requery() shouldn't create a new rowset in memory, it should
> simply refresh the existing rowset and all the linkages to controls on
> the form should still work.  This is not happening.  The solution is to
> reassign the link to the image control's dataSource property after the
> requery.
>
>     function ENTRYFIELD1_onKey(nChar, nPosition,bShift,bControl)
>        form.fish41.params['ag'] = '%'+this.value+'%'
>        try
>           form.fish41.requery()
>        catch(exception e)
>           form.fish41.requery()
>        endtry
>        form.image1.dataSource = form.fish41.rowset.fields["fish image"]
>        return
>

Just curious if you had thought about:

form.fish41.rowset.refreshControls()

as a way to update the rowset on the form? This method of the rowset
should force the controls dataLinked to components on the form to
redisplay correctly.

Ken

--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm



Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0