Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Aug 2002
    Location
    Des Moines, Iowa, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table not updating (XP)

    I have run into a strange problem. I have created an Invoice program which Adds, Updates, or Inquires invoices. It should be a straight forward program. When I pull up an invoice and try to change a field, I get the message that the record has been changed. In debug mode, I checked the value of the field within the immediate window before and after the Update command, and the correct value displays, but when I pull the item up later in inquiry mode, or physically look at the record, the update did not occur. What is causing this strange behavior??

    My first thought (yes, I do occasionally have them!) was that maybe the table link between the .dbf holding the source code, modules,etc and the .dbf containing the data may be corrupt. I recreated the link, but to no avail. I tried another program that updates a different table, and it seemed to work OK. Any suggestions are greatly appreciated. TIA

  2. #2
    Star Lounger
    Join Date
    Aug 2002
    Location
    Des Moines, Iowa, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table not updating (XP)

    Sorry about the duplication in messages... I didn't see the screen change the first time I released the message, so I thought it didn't take. Oops!! The latest message has the best information.

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Table not updating (XP)

    I deleted the previous message (222193) as it was a partial duplicate of this thread.
    Wendell

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

    Re: Table not updating (XP)

    You're going to have to include more detail on how you're performing those updates. Are you using DAO or ADO? From the message, it sounds like you may be running code to make a change behind a form but directly to a table rather than to the form's recordset. It's entirely possible to run into write conflicts when you do that unless you make sure the form or subform record has been saved before you make any more changes. The immediate window will show you the current value of a control, but unless the change is actually committed, the update can still fail. Your best bet is to post the code you're using to update the record so that someone might spot the error.
    Charlotte

  5. #5
    Star Lounger
    Join Date
    Aug 2002
    Location
    Des Moines, Iowa, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table not updating (XP)

    I am using ADO.
    I also after more investigation, found the problem. I was "streamlining" my project by making some private subs being used in several forms programs into modules. (Reusable code... What a concept!) Amongst the modules being changed were opens and closes of tables. In the open module, the .Open and .Index methods are used. The .Seek method I used within the main programs, since field names may be different between the programs. In the program I was having problems with, I forgot to code the .Seek, so nothing was changing because nothing was being accessed.

    Thanks for your time. I was minutes away from sending code when this brainstorm hit. Time for some caffeine to replenish my system (Mountain Dew, the caffeine of choice!!)

Posting Permissions

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