Navigate automatically through table Boxes

Hi, I have a question concerning table box obejcts. I created a form containing a table box. If I run the form, I can see the data held in table and I can move with the mouse manually from line to line. Each time I click on another line with the mouse, the line is getting blue highlighted…I think you know that… So my problem now is, how can I program that moving through the lines. And how can I programm the highlighting of a line in a table box??? Thank you very much for helping me…

You can move through the lines programmatically by using the Rec.FIND and Rec.NEXT functions. The highlighting…???

Hi

quote:


Originally posted by xorph
… The highlighting…???


@Heinz: Easy[8D]!! Do you remember? If nothing works Excel does …[:D]! Name DataType Subtype Length MyXL Automation 'Microsoft Excel 9.0 Object Library'.Application **OnAfterGetCurrRecord()** CLEAR(MyXL); IF CREATE(MyXL,TRUE)THEN; MyXL.SendKeys('+ '); **'+ '** = plus & empty @Uhlig: Cool question! bye André

Just found a nice feature of my solution: If you place the mouse cursor on the Windows Task Menu no record will be highlighted. Mark with Shift & mouse doesn’t work correct. Mark with Strg & mouse works [:)]. bye André

quote:


Originally posted by Andre DDB
Easy!! Do you remember? If nothing works Excel does …!


[:0] Erm… and this is supposed to work??? I mean, you start Excel, send it a "+ ", and this will select records in a Navision form [?][?][?] Where’s my object designer…

Andre, I just tested it: selecting record in the form will behave as usual, i.e. no highlighting. Do i need some extra code elsewhere?

quote:


Originally posted by xorph
Erm… and this is supposed to work??? I mean, you start Excel, send it a "+ ", and this will select records in a Navision form [?][?][?] …


No. You have to select the record by code. AND the comes Excel. I’ve tested it with SetRange(Item.No,MyNo)and a SetRange(Item.No) after the highlighting. It works[8D]. It should IMHO also work with rec.Next. bye André

quote:


Originally posted by xorph
Andre, I just tested it: selecting record in the form will behave as usual, i.e. no highlighting. Do i need some extra code elsewhere?


I understand! Please don’t use the Symbol Menu. Use the cursor keys. But where is the difference??

OK, moving the cursor up and down with the arrow keys will highlight the current record, so I conclude the rest will also work [;)]. But why[?]

quote:


Originally posted by xorph
OK, moving the cursor up and down with the arrow keys will highlight the current record, so I conclude the rest will also work [;)]. But why[?]


Why this work? Shift & Space is the standard in Excel to mark the current row(s) as well as Strg & Space mark the current column(s). I just tried it [:D]. bye André

And what does this have to do with a Navision form? Confusing…

quote:


Originally posted by xorph
And what does this have to do with a Navision form? Confusing…


Heinz, recently we had a talk about results and the ways to them. I said: “… for me counts in most of the cases the result not the way …”[;)]. Uhlig ask for a way to highlight records - I show him a way [8D]. Is there something wrong? Or do I understand your posting wrongly? @Uhlig: If you want to move by the arrow keys- my above solution works. If you want to move by code (e.g. with Next)- you have to unmark the previous current record before you mark the new current record. Otherwise you get a range of marked records. bye André

quote:


Originally posted by Andre DDB
Just found a nice feature of my solution: If you place the mouse cursor on the Windows Task Menu no record will be highlighted. Mark with Shift & mouse doesn’t work correct. Mark with Strg & mouse works [:)]. → How do you mean that ??? Thank you for your help. bye André


Hi

quote:


Originally posted by Uhlig
… Mark with Shift & mouse doesn’t work correct. Mark with Strg & mouse works [:)]. → How do you mean that ??? Thank you for your help. …


I guess you ask for these mark operations. Am I right? Even though the current record is highlighted it is possible to mark & highlight other records also for e.g. copy & paste. This only works with Strg. The Shift - option doesn’t work together with my code. By the way here is the code if you use Rec.Next: CLEAR(MyXL); IF CREATE(MyXL,TRUE)THEN; MyXL.SendKeys('{LEFT}'); //unmark previous current record MyXL.SendKeys('+ '); bye André

Hi, I think there must be something wrong with the code you put in the forum. Sometimes the line in my table is highlighted and sometimes it doesn’t work…? Why doesn’t it work everytime? Here is my used trigger: // this function moves the actual cursor of the table to the line, in which standard is set to TRUE SETCURRENTKEY(Standard); Standard := TRUE; check := FIND; // first I search the line, which should be highlighted… IF check THEN BEGIN CLEAR(MyXL); IF CREATE(MyXL,TRUE)THEN; MyXL.SendKeys(’{LEFT}’); //unmark previous current record MyXL.SendKeys(’+ '); END; Thank You very much for helping me…

Hi Uhlig Where did you put this code in? How do you call the search? I’ve tested in the OnAfterCurrentRecord - trigger. You have to search your record first (e.g. with the OnPush trigger of a button). Then my code should do (in OnAfterCurrentRecord) his job. bye André

Hi, Thank You for the fast answer…I corrected the part, in which I first search a record and in fact now it works !!! ;-)))) But I still have a small problem, maybe you can help me also concerning this case… I created a Form and in this Form there is also a SubForm included. The Subform describes data from a temporary table. If a data-entry from my my Form is selected, the record should be inserted into my temporary table which is illustrated from my subform. The part of inserting data works very well, but everytime I insert a record into my temporary table, the last inserted record is shown two times… If I select the first record with my mouse, that means I highlight the first record, then everything works fine and there is no last double entry anymore. How can I solve that problem??? Thank You very very very much for helping me ;-))) My problem now is, that

The last line “My problem now is, that” is a failure…you can kick it…

Hi Uhlig

quote:


Originally posted by Uhlig
The last line “My problem now is, that” is a failure…you can kick it…


You can edit your postings (and delete such lines) [;)]. Just click on the pencil above the posting. It seems you run the code to insert the new record twice. Try to test it with the debugger. There you should see both inserts. bye André

HI, yes you’re right, obviously that should be the failure…But in fact, there is only one entry inside the table…If I click with the mouse on the first line of the table the double entry is away and no longer inside the table-box. But in my temporary table there is all the time no double entry, only in my table box. What could be the failure??[?]