Need help with Dev2K forms [message #82245] |
Tue, 13 May 2003 11:43  |
Ram nuvvula
Messages: 2 Registered: May 2003
|
Junior Member |
|
|
I have a Dev2K form which displays 10 records at a time with 2 ields Name and Dept. When I queried the data, the data is displayed ordered by Name field.
If there are 500 records and my first record is activated with Name starting with 'A' (e.g. Anu). How can I go to a record that has name field starting with T (e.g. Tom) without scrolling down? Is there any way that if I press T that takes me to the record that Name starts with 'T'?
I would appriciate if any one gives some idea on this.
Thanks,
Ram
|
|
|
|
Re: Need help with Dev2K forms -- perfectly possible. [message #82269 is a reply to message #82263] |
Wed, 14 May 2003 06:59   |
Ram nuvvula
Messages: 2 Registered: May 2003
|
Junior Member |
|
|
Thank for your reply.
My question is : how can I go to a record starting with letter 'T' after I queried all 500 records with starting letters from 'A' to 'Z'. User want to go to particular record ,for say, starting with 'T' without scrolling down manually to that record. If I run a query based on 'T%' criteria then I will see only 10 records with starting letter 'T' but not all.
|
|
|
Re: Need help with Dev2K forms -- perfectly possible. [message #82290 is a reply to message #82269] |
Thu, 15 May 2003 06:57  |
 |
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
Ok, that requires a different approach:
1. Create a control block with 2 items, a text item (e.g. Look_Up) and a push-button (e.g. btn_find).
2. In the when-button-pressed of btn_find you can put code like this:Declare
v_current_record number:= :system.cursor_record;
Begin
Go_Block('data_block');
Loop
If :system.last_record = 'TRUE' then
first_record;
else
Next_Record;
end if;
Exit When :data_block.field_you_want_to_search Like :CTRL.LOOKUP||'%';
If :system.cursor_record = v_current_record Then
Message('No match found for '||:CTRL.LOOKUP);
Message('No match found for '||:CTRL.LOOKUP);
Exit;
End If;
End Loop;
End; data_block = the block you want to search
beware: this code isn't tested, so it is possible it contains flaws, but at first glance it seems pretty fine.
MHE
|
|
|