Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Norfolk, England
    Posts
    744
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Intelligent textbox??? (2000)

    Hi,
    I have a database where the user enters data, mainly contact details, gender, etc. This data contains no names as it is purely used for statistical purposes. However each record has a unique number (not PK) that the record is based on. The number is the format of NNLLNNNNNNNYY, where N is a number, L is a letter and YY is the year (05,06 etc).
    There are several hundred records.
    Currently I have a combo box that lists the unique numbers. But this isn't very user friendly.
    Is it possible that when a user records a new record, beginning with the unique number, that the text box(txtref) used for this searches the existing numbers? What I envisage is this:
    User clicks on Add new record.
    User start to type number in TxtRef.
    36LL
    First record beginning with 36LL is displayed
    User continues to type:
    36LL1234
    First record with 36LL1234 is then displayed
    User continues:
    36LL123456705
    At this point the existing record for this is unique number is displayed, or a new record is created.

    The existing problem is that the user is entering a unique number that is already on the system, the obvious error message is then thrown up.
    The user then exits the database and re-enters it. Then they use the combo box to check to see if the unique number already exists.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Intelligent textbox??? (2000)

    This won't work. Typing in a bound text box changes the value of the field in the current record, you can't use it to jump to another record.

    - You can check in the Before Update event of the bound text box whether you are in a new record, and whether the value is already in use, and cancel the update if so.

    - You can use an unbound text box to search for a record as the user types.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Norfolk, England
    Posts
    744
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Intelligent textbox??? (2000)

    Presumably the best way to broach this would be the second option.
    I'm guessing that I could use the unbound text box to fill the bound text box if the value doesn't exist.

Posting Permissions

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