Results 1 to 8 of 8

Thread: NotInList event

  1. #1
    Join Date
    Nov 2002
    Posts
    7

    Red face Unanswered: NotInList event

    Hi,

    I'm trying to use the NotInList event to add names to a list of names and some other info in a table, if the name entered doesn't exist already, which in itself succeeded.

    However, if I for example have the following names in a list:

    Robert
    Roberto
    Robin

    Would it be possible to use the NotInList event somehow to add the name Rob in the underlying table? With me it always jumps to the first name that has 'Rob' in it, which is not all too strange... but would it be possible to add a name which is the same as the beginning of another longer name that's in the list already?

  2. #2
    Join Date
    Nov 2002
    Posts
    150
    Should be able to do it.

    Set the "Limit To List" property of the compbo to yes.
    In the event method, enter something like this to insert a record in the database/dropdown:

    Private Sub Combo0_NotInList(NewData As String, Response As Integer)
    Dim sSQL As String
    DoCmd.RunSQL ("INSERT INTO TABLE(COLUMN) VALUES (" & Combo0.Value & "')")
    Combo0.Requery
    End Sub

  3. #3
    Join Date
    Nov 2002
    Posts
    7
    Hi Firstandgoal4,

    Thanks for your answer. It is not the answer yet, but I may have not put things into words too clearly.

    I have a NotInList event which actually adds not-yet-existent names into my table, however in the combobox, when I type in a name, it automatically jumps to the name(s) already entered, therefore not allowing me to enter a new shorter name with the same letters as the beginning of one of the existent names in the table.

    In the table are already:

    Robin
    Robert

    --> Rob does not trigger the NotInList event.

  4. #4
    Join Date
    Feb 2002
    Location
    San Antonio, TX
    Posts
    69
    I think someone mentioned in a past post that it's not possible to turn off the autocomplete feature.
    "Doing stuff is overrated. Take Hitler for example. He did lots but don't we all wish he'd have just stayed home and gotten stoned?"

  5. #5
    Join Date
    Aug 2002
    Location
    Singapore
    Posts
    91
    I think, you can just set "Auto Expand" to "No".

  6. #6
    Join Date
    Nov 2002
    Posts
    150
    Originally posted by Tonco
    Hi Firstandgoal4,

    Thanks for your answer. It is not the answer yet, but I may have not put things into words too clearly.

    I have a NotInList event which actually adds not-yet-existent names into my table, however in the combobox, when I type in a name, it automatically jumps to the name(s) already entered, therefore not allowing me to enter a new shorter name with the same letters as the beginning of one of the existent names in the table.

    In the table are already:

    Robin
    Robert

    --> Rob does not trigger the NotInList event.
    If you type in Rob and then hit the delete key and the tab to the next field, the event should fire.

  7. #7
    Join Date
    Nov 2002
    Posts
    150
    Originally posted by Tonco
    Hi Firstandgoal4,

    Thanks for your answer. It is not the answer yet, but I may have not put things into words too clearly.

    I have a NotInList event which actually adds not-yet-existent names into my table, however in the combobox, when I type in a name, it automatically jumps to the name(s) already entered, therefore not allowing me to enter a new shorter name with the same letters as the beginning of one of the existent names in the table.

    In the table are already:

    Robin
    Robert

    --> Rob does not trigger the NotInList event.
    Set Auto Expand to No

  8. #8
    Join Date
    Nov 2002
    Posts
    7

    Talking It's working!

    FirstAndGoal4

    Great,

    It's working very fine now, just like it should. Thank you all for the great help!

    Tonco

Posting Permissions

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