Results 1 to 2 of 2
  1. #1
    heominhon127 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Posts
    4

    Error Msg "Can't find specified record" when trying to add new record!! HELP

    Hi, I am a newbie to Access 2007. I'm doing an Inventory Database for my company and unfortunately I'm running into a couple of problems. But the first one is:

    I have 2 tables: tblAsset with AssetID as PK and tblManufacturer with ManufacturerID as PK.
    I have a main form with several navigation buttons such as Add Record, Update Record and View Report.
    When user clicks on Add Record button, a new form is generated with fields from tables. At the bottom there is a Save button and I want it to perform the adding new record to table. However when I click on Save, there is an error says, "Cannot find specified record". I've seen many threads about this problem but still couldn't figure out the right solution.

    Here's my code for the save button:


    Private Sub btnSave_Click()
    On Error GoTo Err_btnSave_Click

    DoCmd.GoToRecord , , acNewRec



    Exit_btnSave_Click:
    Exit Sub

    Err_btnSave_Click:
    MsgBox Err.Description
    Resume Exit_btnSave_Click

    End Sub

    Any helps will be appreciated!

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    in a client/server database application (i.e. Access and not a web application) - there is no such thing as 'save'. This surprises newcomers.

    An Access form is directly sourced onto its record source (table or query subset of table) and thus the changes one makes is 'live'. It isn't pre-stored like in a browser and then sent to the backend in a 'save' button.

    Now I could design a save mode either with a temp table or all unbound controls - but let's not go there.

    So the code you posted is that to go to new record. That can give the illusion of saving of course - and it should work. I don't see offhand why it does not. Did you make that button using the wizard? Something involving your record source or your button code doesn't sync. As a sanity check you should have navigation buttons at the bottom left to increment thru records (possibly you've disabled in form property) - make those active and try those. Hopefully this will give you a hint as to the cause. Or simply delete that button and make a new one - and see if that works.

    Hope this helps.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 05-04-2010, 06:39 AM
  2. Replies: 3
    Last Post: 02-23-2010, 06:32 PM
  3. Error message and How do I find the "value Field" ?
    By createdwithfire in forum Forms
    Replies: 1
    Last Post: 11-05-2009, 12:26 PM
  4. Replies: 0
    Last Post: 11-03-2009, 11:42 AM
  5. Error "Record is Deleted"
    By koper in forum Access
    Replies: 8
    Last Post: 03-10-2009, 10:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums