Effective Strategies for Access Not A Valid Bookmark. (Error 3159)

Have you encountered a peculiar warning message “Run-time error ‘3159’: Not a valid bookmark” in Access when working with the Recordsets in the VBA code? Don’t worry, you are not alone in this journey. In this article, we will delve into the insights of this error, including its causes and most importantly how to troubleshoot it.

Not A Valid Bookmark. (Error 3159)

Also, we will mention the proficient Access Repair Tool that can assist you in fixing not a valid bookmark Access error if it arises due to database records corruption.

Rated Excellent on Trustpilot
Free MS Access Database Repair Tool
Repair corrupt MDB and ACCDB database files and recover deleted database tables, queries, indexes and records easily. Try Now!
Download
By clicking the button above and installing Stellar Repair for Access (14.8 MB), I acknowledge that I have read and agree to the End User License Agreement and Privacy Policy of this site.

Quick Fixes:

  1. Reproduce an Error
  2. Restoring the Old Database to New Database
  3. Run Decompile Command
  4. Compact and Repair In-built Utility
  5. Try the Access Repair And Recovery Tool

But before proceeding towards the fixes, let’s know something about this error along with the major causes.

What Is Error Code 3159?

The error code 3159 typically occurs when working with records in a form or report, and the bookmark property value becomes corrupted or invalid.

Recordset object based completely on the Access database engine tables. When the value of the Bookmarkable property is set to True, you can use the bookmark property with that Recordset.

What Is Bookmark In MS Access?

In MS Access, bookmark is a variant type value that exclusively recognizes the record in a database Recordset object. Even a variant array of bookmarks can be used with a Recordset Filter technique to filter on a particular set of records.

Major Factors for MS Access Not A Valid Bookmark Error

There are various reasons behind the occurrence of this peculiar Access error. Some of them are shortlisted here:

  1. When the user bookmarks a string that was not saved from previously reading Bookmark Property.
  2. Attempting to open a corrupted Access database file.
  3. When a user uses the bookmark property of recordset objects to bookmark an invalid string.

So, as you have known the reasons, now it’s time to solve this error using the best fixes mentioned in the next section.

Solutions to Fix “Not A Valid Bookmark. (Error 3159)” In Access

Follow the below step-by-step methods to resolve MS Access runtime error 3159 not a valid bookmark.

Solution 1- Reproduce an Error

To reproduce the Access Not A Valid Bookmark Error users need to create the table so that in VBA they can be able to create recordset. After clicking the form button an error 3159 will generated. After this, you have to run the below code in a module:

Code to reproduce the error:

Option Compare Database 
Private Sub Command0_Click()
Dim rst As Recordset
Dim str As String
‘Error 3159 Not a valid bookmark.
Set rst = CurrentDb.OpenRecordset(“Table1”, dbOpenDynaset)
str = rst(0)
rst.Bookmark = str
End Sub

Not A Valid Bookmark. (Error 3159)

On an error message window, you have to:

  • Click on Debug option
  • Then, use an accurate string.
  • After this, update a string & save it.

Also Read: Fix Run-Time Error 3047- Record Is Too Large Access

Solution 2- Restoring the Old Database to New Database

Sometimes the reason for the corruption of access file relationships or records is also the excessive file storage in the Access database. At that time it’s compulsory for the users to create a new file and export the data from the corrupted databases. If you don’t know how to perform this task then just follow these steps:

  • First of all, start MS Access select the blank database present in MS Access, and opt for OK button.
  •  Assign a name to the new database select a file location and use the Create option.
  • Tap to the file menu and then move to the external data and opt for Import.

external data

  • Tap the file menu, switch to external data, and opt for import.
  • Browse and select the corrupted database and tap on the import option.
  • If users don’t get the object Window showing Import then the process can’t be recovered to the Access Database.
  • Make a selection for the Select on Tables present on top of the Import objects Windows, and opt for Select all.
  • Repeat for the tab on the screen and hit the OK button in case the process gets over.

Solution 3- Run Decompile Command to Fix Not a Valid Bookmark. (Error 3159)

Decompile command is another effective way that can be tried to solve how to fix not a valid bookmark in Access. However, this command is mainly used for solving error and issues related to VBA projects.

Follow the below steps to run a Decompile command:

1- Identify your MS Access path. For this, go to the Windows Explorer and search for the Microsoft Access program.

2- Then, press Win + R keys together to open the Run box, type CMD & hit Enter to open a Command Prompt.

how to fix not a valid bookmark in Access

3- Now, you can see the cmd.exe window is shown.

cmd.exe

4- There, you have to enter the below command (Decompile command):

C:\Program Files (x86)\Microsoft Office\root\Office16\MSACCESS.EXE /decompile

5- At this time, open the Access database >> click on Create >> Module.

6- Now, go to the Debug > Compile option.

7- Finally, click on File menu & then Save option.

VBA

This should fix the error 3159 in your Access database successfully.

Solution 4- Compact and Repair In-built Utility

Before using the compact & repair built-in tool, users should keep these things in mind.

  • Always make a backup of the files.
  • Compact and Repair the databases automatically.
  • Note down the System recovery error table.
  • Get the access to database to make use of the Compact and Repair database command.
  • Get sufficient permission to run compact and repair functions.

The inbuilt utility tool works in two ways:

Way 1- When Database are opened by the user:

  • Click on File tab ⇒ Opt for Info ⇒ Select Compact and Repair Database Option

Compact and Repair Database

Note: in this case, the other users are using the database file, and then this function can’t be performed.

Way 2- The database not opened by any user

  • Firstly, Start MS Access but do not try to open the database files in it
  • Point towards info ⇒ Click Compact and Repair Database
  • In the dialog box of the database to compact form, navigate and double-click on the databases to be repaired.

Solution 5- Try the Access Repair And Recovery Tool

To resolve this particular Access Query Error Not A Valid Bookmark you must try out the professional tool i.e. Access Repair And Recovery tool. This tool is specifically designed to deal with the MS Access database corruption issues. Moreover, the software effectively recovers inaccessible MDB and ACCDB files accurately from corrupt or damaged MS Access databases.

The notable highlight features of Access Repair And Recovery software are:

  • Makes easy recovery of MDB or ACCDB files from any kind of corrupt databases
  • Retrieves complete table structure and most important of all internal data structures such as primary keys, auto-number, and field sizes accurately
  • Quickly retrieves table relationships, OLE data, Memo data, etc.
  • Before starting up the recovery process you can see the preview of your recoverable data.
  • Also, supports password-protected database .accdb/.mdb file recovery.
  • Support recovery from entire MS Access database 95/97/2000/XP/2003/2007/2010/2013/2016/2019 version.

* By clicking the Download button above and installing Stellar Repair for Access (14.8 MB), I acknowledge that I have read and agree to the End User License Agreement and Privacy Policy of this site.

Steps to Use Access Repair Tool

access-repair-main-screen
access-select-database
access-repairing
access-repairing-completed
access-preview
access-save-location
access-saving
previous arrow
next arrow

Also Read: Fix Run-Time Error 3047- Record Is Too Large Access

Users Queries & Answers

Why Is My Database Showing This Error Even After Updating Access?

Your database showing this error even after updating the Access, it is likely the database is corrupted.

Are There Alternative Databases To MS Access?

Yes, there are numerous alternative databases to MS Access such as MySQL, Microsoft SQL Server, Oracle, and more.

When Should I Consult A Professional For Help With Error 3159?

Even after trying the fixes mentioned in this post, if the error persists, it is advisable to see a professional help to solve error 3159.

Bottom Line:

Error 3159: not a valid bookmark Access can be a baffling issue, but with the correct knowledge & troubleshooting steps, it is totally manageable. By following the solutions discussed in this blog, you can deal with this error effortlessly.

Moreover, to avoid this error in the near future, regularly back up the database, validate bookmarks, and keep your Access software up-to-date.

Thanks for reading!

References:

tip Still having issues? Fix them with this Access repair tool:

This software repairs & restores all ACCDB/MDB objects including tables, reports, queries, records, forms, and indexes along with modules, macros, and other stuffs effectively.

  1. Download Stellar Repair for Access rated Great on Cnet (download starts on this page).
  2. Click Browse and Search option to locate corrupt Access database.
  3. Click Repair button to repair & preview the database objects.

Pearson Willey is a website content writer and long-form content planner. Besides this, he is also an avid reader. Thus he knows very well how to write an engaging content for readers. Writing is like a growing edge for him. He loves exploring his knowledge on MS Access & sharing tech blogs.