Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Raleigh, NC
    Posts
    183

    Question Unanswered: ??????????????????

    I have main form and subform with in my mainform.

    Main form CustID format is XXX-XXXX-X-X (ex: 123-4567-8-9)

    Now in my subform i have OrderId which i want to be same format as CustID. Only diff it would is the last digit in Order ID. So for example if CustID is 111-1111-1-0 then OrderID would be 111-1111-1-1 next OrderID should be 111-1111-1-2. Is it possible in Access that i can do something so that the User don't have to type in the whole CustID in OrderId field.

    I would somehow like my user to only enter the last digit of OrderID since all the other digit will be same as CustID. How can i do this ?
    Skharva

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    sure.

    In your tables, drop the last character of the cust-id.
    Have a seperate field for the last digit in the Order-ID

    In each place the Cust-Id is displayed or printed, add "-0" to the value so that it shows up correctly.

    make the cust-id field the "parent-child" for your subform, and use some code to index the seperate "last character" field.

    when a new record is added to the sub-form, access will automatically add the value of the "Parent field" into the "Child field".

    Have fun!

  3. #3
    Join Date
    Sep 2003
    Location
    Raleigh, NC
    Posts
    183
    Originally posted by tcace
    sure.

    In your tables, drop the last character of the cust-id.
    Have a seperate field for the last digit in the Order-ID

    In each place the Cust-Id is displayed or printed, add "-0" to the value so that it shows up correctly.

    make the cust-id field the "parent-child" for your subform, and use some code to index the seperate "last character" field.

    when a new record is added to the sub-form, access will automatically add the value of the "Parent field" into the "Child field".

    Have fun!
    Do you have any example of how this works or code ?
    Skharva

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Use the DMax function, with the cutd-id as filter (providing that narrows the search sufficiently) and then add 1 to it.

Posting Permissions

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