Questions tagged [ms-access]

Microsoft Access, also known as Microsoft Office Access, is an application development and database development tool from Microsoft. It combines the Microsoft Jet/ACE Database Engine with a graphical user interface and software-development tools. Other database engines, such as SQL Server, can also be used as a database server for Access applications.

Microsoft Access, also known as Microsoft Office Access, is an application development and database development tool.

It commonly uses the Jet or ACE database engine, but is not limited to these.

It is a member of the suite of applications, included in the Professional and higher editions or sold separately. The current version is Microsoft Access 2016.
Applications built with Microsoft Access can be distributed to end users with a free run-time version of the application that lets them view databases without needing the full installation of Access.

This tag is version-agnostic. If you have a question about using a specific version, please tag your question appropriately so others know what version you are using. Ex:

and or if your question involves VBA.

Links

Common errors

Reserved Words

One of the most common problems with MS Access SQL is the use of a reserved word in a query or SQL string. It is often suggested that these words are bracketed, [RESERVED WORD], as is required for field (column) names containing spaces or special characters. But rather than trying to figure out what is and is not a reserved word and bracketing only those, using the convention of prefixing all field names with the table name — or better yet, the alias — will prevent this problem from occurring. This will save problems in other cases, not just reserved words. For example:

 SELECT a.id, b.id, b.name 
 FROM tablea a
 INNER JOIN tableb b 

It also makes the SQL compatible with other databases.

Connection Strings

The usual connection string for MS Access *.accdb files, that is, files created in Access 2007 format, is:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;

The ACE connection string is backwards-compatible and will open *.mdb files; however, for *.mdb files, you can also use:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myFolder\myAccess.mdb;

Jet is often installed by default on Windows systems, but ACE is not. ACE is available in both 32-bit and 64-bit.

53481 questions
4
votes
3 answers

Validating email To field value in VBA

I am looking to validate values sent to an Outlook email in VBA I have found several examples, such as :- http://www.geeksengine.com/article/validate-email-vba.html Using the code from the site above, the email address 1@1.com is returned True, or…
bd528
  • 843
  • 1
  • 10
  • 24
4
votes
1 answer

When opening a RecordSet in Access VBA, if the type is dbOpenSnapshot, does it make the option dbReadOnly redundant?

In Access VBA, when opening a recordset as a snapshot, does it make the read-only option redundant? At first this seemed to be true, since a snapshot is essentially read-only already, but there always seems to be caveats. Example: Dim acc as…
spinjector
  • 2,534
  • 1
  • 19
  • 39
4
votes
1 answer

What error number could I use with CVErr() to indicate no value would be returned from an Access VBA function?

What error number could I use with CVErr() to indicate no value would be returned from an Access VBA function? I'm pulling blanks. CVErr(5) could work, but I'm hoping for something less generic. 744 ("Search text not found") is close (-ish), but…
spinjector
  • 2,534
  • 1
  • 19
  • 39
4
votes
2 answers

How to set a reference to a running object in Access VBA

I try to open a form in another database by using GetObject. Unfortunately I have to open a second instance of the database, but I would like to use the active instance of that database instead (if loaded). TO accomplish this I need to set an object…
Art
  • 390
  • 2
  • 12
4
votes
4 answers

MS Access: Action "onchange" event after a delay?

Good morning! I have a "fancy" search function in Microsoft Access where the list of possible options shrinks as you type in the search field. Unfortunately the computer and server can't keep up with these rapid requeries of the data. Currently the…
4
votes
2 answers

When using OleDBDataReader to select a memo field from an Access database it only returns part of the string. How can I get the whole string?

This is my code: OleDbConnection connection = new OleDbConnection( "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\\Offline.accdb;Persist Security Info=False"); connection.Open(); OleDbCommand command =…
Stephen Oberauer
  • 4,898
  • 5
  • 48
  • 72
4
votes
3 answers

vbUseCompareOption missing from Enum members of vbCompareMethod

Many online, including Microsoft's, help resources (for example) for functions that accept a vbCompareMethod state that there are 4 possible values: vbUseCompareOption = -1 'Doesn't seem to exist vbBinaryCompare = 0 vbTextCompare =…
ThunderFrame
  • 8,851
  • 2
  • 24
  • 53
4
votes
4 answers

How to SetFocus on a TextBox in the Form Load

Working in both A2003 & A2007. How do we ensure that a selected TextBox gets the focus when the form loads? If we put MyTextBox.SetFocus in the Form_Load then we get the error: can't move the focus to the control This form is designed for rapid…
hawbsl
  • 13,626
  • 23
  • 67
  • 109
4
votes
4 answers

Inserting records into a Microsoft Access database in C#

I am inserting data to access 2000-2003 file format database using C#. When I had a database with 2 fields the query works fine, but when there are more fields its is not working. I have identical code for both and I am not able to find the…
Beginner
  • 325
  • 2
  • 5
  • 17
4
votes
1 answer

Develop MS Access 2016 AddIn (Ribbon / VSTO) with Visual Studio 2015

Hope you can help me. I am looking forward to programming my first MS Access AddIn with Visual Studio 2015 (a Ribbon-Bar as VSTO), but not having started I have to stop already. Visual Studio provides templates for almost every office product, but…
rodgerwilco
  • 193
  • 12
4
votes
2 answers

Access VBA changes uppercase & lowercase randomly

I have a coding project in MS Access. There are some developers coding and checking in the source-code to a SVN-Server. As a SVN-Server is for managing code, it recognizes changes in the source-code files. In these source-code-files there is a…
rodgerwilco
  • 193
  • 12
4
votes
2 answers

Importing an Excel Listobject into an Access table

I have an Access database with a table named InventoryAvail. I'd like to push a button in Access and import a specific Listobject from a specific Excel file to fill the InventoryAvail table. What vba code do I need to put on the button's event?…
Hawsidog
  • 111
  • 2
  • 12
4
votes
2 answers

How to set a validation rule on a field in Access using SQL Query?

I am using MS Access 2016 (Office 365) and I am currently facing an issue. Below is an example demonstrating this issue. Here I created a Table named as NodeFamilyLink, which consists of two fields: NodeID and FamilyID as shown below. Now the…
WarWithSelf
  • 565
  • 1
  • 10
  • 36
4
votes
3 answers

2010 Access - how to add and work with shapes in Excel file

I would like to add shapes and modify them from 2010 Access vba in an Excel worksheet. The code I wrote based on Excel 'record macro' is: StrSheetName = "Menu" wkbModels.Sheets.Add(before:=wkbModels.Sheets("Models")).Name = StrSheetName Set…
LEBoyd
  • 139
  • 8
4
votes
1 answer

Ms Access VBA go to last record

I am trying to open a form and move to last record. I am using the following DoCmd.RunCommand acCmdRecordsGoToLast The form open and go to last record, but it is hiding the other records(I must use the scroll bar). This might confuse users that…
YvetteLee
  • 1,010
  • 2
  • 11
  • 26
1 2 3
99
100