Table Key - Auto Increment

deprodepro Member Posts: 46
Hello,

I am trying to make table with key: "Document No." (Code 20), "Type" (Option), and "Line No." (Integer).

Other fields are: Address, Comment etc.

I set Auto Increment Proporty on "Line No." field to Yes.

Then when I insert record to his table I get resoult like that:


Document no. = A, Type = L, Line No. = 1
Document no. = A, Type = L, Line No. = 2
Document no. = A, Type = L, Line No. = 3

But what i need is to start "Line no." with 1 on every new combinacion of "Document No" and "Type".

Is there any property to set "Line no." to start with 1 on every combination?

Or do i make some hardcoding implementation?

regards,
Depro

Answers

  • kapamaroukapamarou Member Posts: 1,152
    Look at how the Sales Order Form / Subform works. The line number though is 10000 - 20000 ...
    If this does not suite you, I think you'll need to write code for this.
  • JedrzejTJedrzejT Member Posts: 267
    IF this key is Primary then BEGIN
    just use AutoSplitKey=TRUE on form, - but then system will number line No. - 10000, 20000, 30000 for every new
    combination of Doc Type,Option.
    END; 8)
  • deprodepro Member Posts: 46
    Thanks guys,

    AutoSplitHey property is what i need.

    regards,
    Depro
  • DenSterDenSter Member Posts: 8,305
    Make sure you turn off autoincrement for that field
Sign In or Register to comment.