Home » Developer & Programmer » Forms » next record/previous record problem...help....???
next record/previous record problem...help....??? [message #115444] Mon, 11 April 2005 12:31 Go to next message
ramisy2k
Messages: 150
Registered: April 2005
Senior Member
Hello,

I'm using a tlist item (The tlist Item is a non database Field). While

Quering, I fetch all the records (say match_id, team1, team2, date) from a

table in to that tlist item. The tlist is populated with about 4000 records

from a table, which is fine.

Now when I click on the tlist Item values the 'match_id' of the clicked match

is transfered to another non-database item (i.e. 'get_matchid_textitem')
and using the following code on 'when list activated trigger'


:tlist_block_name.get_matchid_textitem := :tlist_block_name.tlIST_name;
GO_BLOCK('match_details');
SET_BLOCK_PROPERTY('database_detail_MATCH_block',DEFAULT_WHERE,'WHERE

MATCH_ID = :tlist_block_name.get_matchid_textitem');
EXECUTE_QUERY(NO_VALIDATE);


the corresponding full match details are shown in another block which is a

database block. I mean the full details about that match.


My problem is : When I pressed next record button or Key down key, It is not

showing me next record. It just displays that record whose match_id is passed

to the current block from the tlist block. My Next & Previous Buttons are

getting disabled automatically. So I can't go to next and previous records.

suppose I clicked on a one of the match on the tlist whose match_id = 1234

this value is passed to 'get_matchid_textitem' and then the above mentioned

code takes me to the match in the 'detail_match_block' where match_id - 1234

and the full match details are shown..

now if i want to go to the match number 1235 (which is the next match in the

detail_match_table)
or if I want to go to the match number 1233 (which is the previous match in

the detail_match_table)

so, what i want is that when the user clicks any of the match in the tlist then It should execute that detail along with previous/next record on pressing Key Up/Down respectively.

what should i do to achieve this...i would be grateful for ur kind help

hope my problem would be clear to you..


regards,
Ramis.





Re: next record/previous record problem...help....??? [message #115481 is a reply to message #115444] Mon, 11 April 2005 19:54 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I have philosphical questions concerning your approach but to answer your question.

Place two buttons on your screen. In the 'left' button place a when-button-pressed trigger and put the following code in it.

:tlist_block_name.get_matchid_textitem := :tlist_block_name.get_matchid_textitem - 1;
GO_BLOCK('match_details');
EXECUTE_QUERY(NO_VALIDATE);

For the 'right' button use '+ 1'.

If you wish, you may place this code in the block's UP and DOWN, and PREVIOUS-ITEM and NEXT-ITEM triggers. Alternatively, place the code in one pair of triggers, and from the other pairs of triggers use the DO-KEY facility.

[Updated on: Mon, 11 April 2005 19:55]

Report message to a moderator

Re: next record/previous record problem...help....??? [message #115482 is a reply to message #115444] Mon, 11 April 2005 19:57 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
This may not work as I thought. You may have to do an ENTER-QUERY, increment or decrement the 'key', then do the EXECUTE-QUERY.
Re: next record/previous record problem...help....??? [message #115572 is a reply to message #115482] Tue, 12 April 2005 13:33 Go to previous message
ramisy2k
Messages: 150
Registered: April 2005
Senior Member
Hello djmartin

many many thanks
the code in your first reply worked perfectly...you have solved my big problem...I am grateful to you...
Regards,
Ramis.
Previous Topic: Do you want to save the changes you have made
Next Topic: Checked the checkbox programatically.
Goto Forum:
  


Current Time: Thu Sep 19 16:26:02 CDT 2024