Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Posts
    2

    Unanswered: Computing a field in a report

    Hello everybody and I hope someone can help me. I want to compute a new field from two other fields in a form. I have a form thats based on a query that involves 3 tables, in the form I have it sorted by four levels.
    I have it sorted by a main field(text) which only can have two values, then I have it sorted by another text field which can have one of three values and then I have it sorted by a rating(number field) and finally by a name field. My question is I want to be able to add a field that would assign a number based on the order on the report. So I want the first record on the report to be assign number one because its the first the second and third and so on.

    Is my thinking right that I would somehow have to add the fields that I'm sorting by in order to get the number I want.

    Thanks and I hope thas clear.

  2. #2
    Join Date
    Oct 2002
    Location
    NSW Australia
    Posts
    61
    If you just want a incrementing Number listed beside each record like1,2,3,4,5 etc then try this:

    create an unbound textbox in the section where you want the number displayed. (txtCounter).

    Right-Click on the divider directly above this section and choose properties.
    Build Code in the OnFormat event.
    and type this:

    me.txtCounter = me.CurrentRecord

    thats it !
    HTH :0)

  3. #3
    Join Date
    Jan 2003
    Posts
    2
    That worked like a charm and here I was trying to make it more complicated then need be. Thanks so much.
    Actually one more thing, what if I wanted to store that value in a table.
    How would I go about usiing the incremental numbers but one that is based on three other values or groupings. Is that possible and once againg thanks for the prompt reply to my question. Your the best

  4. #4
    Join Date
    Oct 2002
    Location
    NSW Australia
    Posts
    61
    Don't really follow on what you want to acheive. you can use the same method in a form based on your query with an unbound field, so there generally is no need to store it.
    Glad to help if you can explain a little clearer on your desired outcome.

    ;o)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •