Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create Client Code (A2000)

    Not sure if this is possible but here go's.

    With our database, we create client codes manually.
    I would like if possible to create them automatically.
    Here's the scenario.

    Client: Willett D
    We would create a client code of WIL001

    Client: Evans C
    We would create a client code of EVA001

    Client: Evans J
    We would create a client code of EVA002

    The client would have other details such as Address, Tel No etc etc.
    Each client has to be unique so if he uses us again at a later date, we can re-use the code.

    The questions are, how to create the code.

    I'm thinking of a possible way as follows.
    It won't be correct but may give you an idea on how I need this to work.
    ================================================== =========

    Clients Surname and Firstname are enterred.
    Code fires to check if this clients details are already in the database and an option to choose.
    If details are not.
    Then code created ie:
    Me.[txtClientCode] = "EVA" & Dmax("???????????","??????") +001

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Create Client Code (A2000)

    My first question would be, is it really necessary to create a customer code that is made visible to the user? Isn't it really better to identify customers by their name? For example, you have Evans J and Evans C, which get IDs of EVA001 and EVA002. Looking at this ID later, which is which?

    In most situations, I use an autonumber as the unique customer ID. This number is never made visible to the user. All customer selection is made by entering the name in a combo box (in which the dropdown also shows addresses), then selecting the correct customer.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Create Client Code (A2000)

    While I agree with Mark about the headaches with creating your own client codes, I also know that clients like shortcuts they can use ... even when there's a better way. I've attached some code from an old project of mine that does the same kind of thing. Maybe you can adapt it to your uses.
    Attached Files Attached Files
    Charlotte

  4. #4
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create Client Code (A2000)

    Thanks Charlotte.

    This is probably just what I was after.

    Merry Christmas and a happy New Year

Posting Permissions

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