TableBox Scrolling

poloniouspolonious Member Posts: 64
Hi,

Here's a good one! I have a tablebox with two fields, on a small form that shows a list of item numbers. The second field is a Qty. field that is populated by a textbox elsewhere on the form. What I would like to do is, as each item is populated with a quantity, I want the list to scroll down to show the next item without a quanitity. The tablebox shows 6 lines, but it could have any number of records. Of course the user can simply use the scrollbar, but the form is on a handheld device and it would be easier if it automatically scrolled each time. Anybody got any ideas??

Cheers,

P

Comments

  • BeliasBelias Member Posts: 2,998
    did you try:
    rec.setrange(quantity,0);
    rec.findfirst;
    rec.setrange(quantity);
    currform.update; //don't know if it is needed
    
    you can do this in the onvalidate, of the quantity...
    just try it, cause I don't know if it generates problems :-k
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • poloniouspolonious Member Posts: 64
    Cool thanks Belias, I'll try it now and come back to you in a few mins.
  • poloniouspolonious Member Posts: 64
    That worked a treat thanks Belias. Solved
  • BeliasBelias Member Posts: 2,998
    Really?!?! :shock: ... test it carefully...i did some tests here and it appears to have some probems...
    try to modify a record, putting 0 in it for example...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • poloniouspolonious Member Posts: 64
    Yeh it's doing what I want it to do anyway. I left out the Currform.Update because it was trying to modify the record. If I was to leave it in, I would have had to add (False) to the end of it. But it wasn't needed.
  • kapamaroukapamarou Member Posts: 1,152
    You can do the following:

    Create a record variable (rec2) for the same record as the form Rec.

    Then:
    rec2.RESET;
    rec2.COPYFILTERS(Rec);
    rec2.SETRANGE(Extra Filter Here); //<- Add Additional filters you need...
    IF rec2.FINDFIRST THEN 
      Rec := rec2; //<- Don't make any modifications to rec2...
    
Sign In or Register to comment.