Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Not In List problem (A2K SP3)

    I use a routine to add a new company if it's not in my company list (table) by passing the company name to a form. I am using the code from Q197526 from microsoft. It has usually worked just fine, but today I noticed it is doing something weird. When it pulls up the new form, instead of going to a new record, it is going to a specific record. Although it brought the company name over and placed it in the right field, all other fields are blank as expected but the ID field (autonumber) shows an already used number (e.g., 17). Of course I can't save the record because the ID number is already used. So, I back out without creating a record. I try again, only this time the ID field has incremented and shows 18! I can quit the form, re-enter the name and the new form increments again. I quite Access, opened again and same thing. Same thing from a cold reboot. I'm up to 43 now and have no clue to why this is happening. The underlying table has about 600 records in it, so this is definitely not the next autonumber in it.

    I pulled up an old program I built in October and it' s working correctly there. Code is the same; field names the same. Do you have any ideas what to look for?

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

    Re: Not a Not In List problem (A2K SP3)

    What happens if you compact and repair the database and then try it? BTW, this is a bug in Access 2000 that has been fixed and reintroduced several times with various patches and has nothing to do with NotInList.
    Charlotte

  3. #3
    New Lounger
    Join Date
    Jul 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not a Not In List problem (A2K SP3)

    I had done that too, just forgot to include it. Since I posted the problem I worked with the code line that is:
    DoCmd.OpenForm "frmPrimaryCompany", , , , acAdd, acDialog, NewData
    I started with the code up to the commas, then added one parameter at a time and tested. When I don't have NewData, I go to a new record. When I put NewData back in, I go to the next sequential number of my "tries" (e.g., 55).

    I see there was a new Windows update on the 18th, but no new Office patches recently.

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

    Re: Not a Not In List problem (A2K SP3)

    You probably have code in the On Open or On Load event of frmPrimaryCompany. Could that be the culprit? If you're not sure, post the code here.

  5. #5
    New Lounger
    Join Date
    Jul 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not a Not In List problem (A2K SP3)

    Meanwhile I decided to copy the structure of the base table I was trying to add a record to. Then I appended the records to it. I replaced the old table with the new table and ran my form. It works now...........wish I'd tried that this morning and I wouldn't have wasted my day! Thanks for your help anyway.

Posting Permissions

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