Microsoft Access





Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have this code:

    DoCmd.OpenReport "Statement", acViewNormal
    DoCmd.PrintOut A_PRINTALL, , , acHigh, 2, 0
    DoCmd.Close A_REPORT, "Statement"

I want the 2 identical statements to print one after the other, is not working
In search of the top Web Browsing Reporting solutions. Implementation types and the Pro's and Con's.
Hi all,

I'm looking for some help writing a rather complex query against my Access database. I have no dedicated SQL experience, only advanced Excel/Access experience.

I have a single database setup that has orders going back 6 years.

I'm trying to compare the Historical orders with the Current orders and flag the Current Orders that fall within a -120 & +90 date window around the expected contract End Dates from the Historical Orders. Problem is that for large customers, they can have hundreds of orders, all with different date ranges, and they all don't need to be flagged. Only the ones that fall within the window in which we expect the next order to be placed.

I've created unique customer ID's for all customers so that part is not the problem. Only the date window piece.

Any help would be much appreciated. I'm open to exploring all options as well, this doesn't necessarily need to be done via SQL if there is a better known way.
I am looking for a relational database solution that works with SharePoint O365.  I have developed a solution using AccessWeb but 1) it does not have that much functionality compared to Access and 2) I understand that AccessWeb is being phased out over the next year or so.

I would welcome some advice on what platform I can use to develop the RDMS.  I have looked at PowerApps but there does not seem to be much literature on how to build a full solution.

Any thoughts would be appreciated.
Hey Dudes,

I have a file that I would like to import into access, now in that file there's a field called "Category Path". In this field there's a varying amount of information and this changes from row to row so it might be abit tedious.

What I would like to know is how would i got about trimming some of the data away leaving the information that I can use. Some of the information is before and after the data that i need.

I am thinking i may need to run that script/query and create a whole new table from it to get what I want.

See examples.


(Before) :Component:DRAM Memory:Desktop DRAM:DDR3 (240 Pin):DDR3 1066:
(After) "DRAM Memory"

(Before) :Component:Solid State Drive:SATA3:
(After) Solid State Drives

(Before) :Component:USB Drive:2.0 USB Drive:32GB:
(After) USB Drive

(Before) :Electronics:Accessory:
(After) Electronics

(Before) :PC & Laptop:Accessory:Battery & Charger:
(After) PC & Laptop

(Before) :Hardware & Software:Server & Workstation:Workstation Barebone:
(After) Hardware & Software

Is this even possible in Access??
We have started using rich text fields in our Access application.
Our customers have noticed that when they type tel:xxxxx in any of these boxes, it becomes a hyperlink (blue and underlined).
I can reproduce it on my computer.
All autocorrect features are turned off.  Each field is set to autocorrect FALSE.  The fields are not hyperlink fields.
If you type a long text and in the middle insert tel:xxxxx, only that part is underlined.
I have tried to turn off the autoformat options in Word in case Access is using the same settings.  I cannot find any options for autoformat in Access.
Does anyone have an idea where to look?  I cannot find any information that concerns this.

Best regards
Benny Floden, RCC INT
Tried the below example and pointed it do my linked table but no records were populated.
I have a database with numerous tables, forms, reports, etc. While working on one of the forms, a contact (object) somehow got deleted from everything (cannot find any reference to it in any of the tables or reports where I know it was). I have a backup of the database, but I cannot find a way to import/copy all references of the contact throughout the database (without simply reverting to the backup, as I have made many other changes within the database that I would like to not have to redo). Is this possible?
how to create the time tracking for a project from timesheet of employees.i need to create a timesheet for a project from the timesheet of employers
Hi All,,,

How to hide the last row (id*) for adding new record in a sub form .

Hi I am workin with MS Access .
 I have a checkbox called " Gedowload" . I would like it if i checked the checkbox the date should apear in a colum " Datum Gedownload"

How should I do it and if i should enter a code where should I enter it...
Hello everyone. I have an Access frontend linked to an MS SQL backend. An employees table has a field for each employee's photo (EmpPic). The data type (per Microsoft's advisory) is varbinary (MAX).

I am trying to use to PictureData property to set the value of a blank image box (Image81) to the content of the photo field. I can do it by VBA by typing:

Me.Image81.PictureData = Me.EmpPic.Value

However, I am trying to accomplish the same thing by a macro by using the SetValue action by typing

Set: [Form].[Image81]
To: [Form].[EmpPic]

When the macro runs, I get the error:

Access failed to evaluate one or more expressions because 'PictureData' was referenced in an expression. Only functions and properties that are considered to be safe are allowed in expressions when Access runs in sandbox mode.

How do I fix this? I would really love to do it via a macro. The entire Access frontend uses macros and no VBA. Thanks.
Hi There,

Let me start by saying I do not have a clue about Access other than use the existing database for entries and use the already customised  reports. Currently I have few databases that I use to enter the data and export the time sheets (which comes as one file) then extract each page and email them to individuals. The problem apart from being time consuming for doing 5 databases, the sensitivity of information (timesheets) are a stressful exercise every bi-weekly as we need to make sure the time sheets dont interchange or go to wrong person, has happened a couple of times in the past. Is there a way to Access to send the time sheets in PDF format to individuals for a specific period of time being rest assured it reaches the intended person. I can give information, but an heads up, it will be in a lay man's version.

Appreciate your help and advise.
Thanks & Regards
Hello , I migrate MS Access to sql server and linked the tables But Few linked table are read only but i can insert the records directly on the SQL server but not from the MS Access , Any ideas what could be the cause ?

To Add to this i have few pass through queries and after Doing google i understood pass through queries make base tables Read Only and few forums suggested i use with NOLOCK in the queries
I have the following code working well to create a new Access database file and copy certain records over to it.  But I am not getting the relationships copied over via lines:

    'Copy relationship between the two tables
    Set rel = .CreateRelation(Name:="[rel.Name]", Table:="[rel.tblDataHeader]", ForeignTable:="[rel.tblDataDetail]", Attributes:=[rel.Attributes])
        rel.Fields.Append rel.CreateField("[fld.Name for relation]")
        rel.Fields("[fld.RECORD_NUMBER for relation]").ForeignName = "[fld.RECORD_NUMBER for relation]"
        .Relations.Append rel

Open in new window


Private Sub cmdArchiveTables_Click()

    If IsNull(Me.txtDate) Then
        MsgBox "You must enter a date."
        Exit Sub
    End If

    If MsgBox("This function will archive data records per the date range you have specified.  Please be sure to create a backup file copy of your current working database before proceeding.  Do you wish to continue??", vbYesNo + vbQuestion + vbDefaultButton2) = vbYes Then

    Dim ws As Workspace
    Dim db As Database
    Dim LFilename As String
    Dim tblDataHeader As Object
    Dim tblDataDetail As Object

   'Get default Workspace
    Set ws = DBEngine.Workspaces(0)

   'Path and file name for new mdb file
    LFilename = Me.txtFileNameAndLocation & ".accdb"
    MsgBox Me.txtFileNameAndLocation & ".accdb"

   'Make sure there isn't already a file with the name of the new database
    If Dir(LFilename) <>

Open in new window

I am fairly new to access but I am playing around with the Product Inventory Template offered by Microsoft for a small business operation. I want to add a new field to the PurchaseOrders table that will calculate taxes automatically for me because right now taxes must be added manually to the table rather than through a form. Since the table already has a Taxes field, I just need to add a Tax Rate field so that I can right a quick script that will calculate the taxes for me. When I try to insert a new field nothing happens, it just disappears immediately. I assume that there is some sort of lock on that table, but I cannot find a lock of any kind. Does it have to do with this table being attached to a form?
I have two tables in Access: Table one has two fields: ID and NPI. The second table has 3 fields: ID, NPI, and Match (Y/N).

I need to create a relationship between the NPI in both tables, and then generate a query that looks like the 2nd table, but where Y or N is put in the last field (Match N/Y) depending on whether there is a match between the two tables (Y) or not (N).

Can this be done in Access?
I am new to Access.  I inherited a database that I did not create, but am trying to maintain.  This is a work-related database.  I cannot upload the database due to sensitive content. The database contains a form.  The form has a field that allows users to upload files (usually pdf and Outlook msg) to the record.  In the past, the upload feature was working correctly.  Recently, at random times, when trying to upload a file, the following error message appears:  Cannot open database "It may not be a database that your application recognizes, or the file may be corrupt."  After this error appears, users are not able to upload any additional files. In order to correct the problem, I have been obtaining a restored back-up file from our IT department.  I would like to know: 1) Is there a way to view or create an Error Log in Access? 2) Is there a way to debug the error? 3) Any ideas on what is causing the error?
We have an Access Automation Software where we are opening up an instance of MS Access 2016 using COM and fetching some data of tables/reports etc from the Access Database.
Once done, we close the MS Access Database by -

1. Calling Database.Close()
2. Assigning null value to the referenced variables
3. Calling CloseCurrentDatabase() of the Access Application Object
4. Finally Calling Quit() method of the Access Application Object
5. Assigning null value to the Access Application referenced variables
6. Calling GC.Collect() & GC.WaitForPendingFinalizers() in a separate thread.

Doing all of the above kills MS Access 2013 instances but fails to do so for MS Access 2016.
The processes linger on for some time and keep consuming ~50 MB RAM and ~10% CPU even though our automation is completed and our code has quit. We find that these processes get killed some time later.

This lingering on of processes is causing High CPU / RAM usage issues as we sometimes find more than 50 instances open.

Is there any known issue in MS Access 2016 while closing or does it connect to post activity (like connect to some server and send data) when its Application.Quit is called.

Would appreciate some advice in this regards.
Hi All,,,
How to force the Combo Box to Requery/refresh after typing some text in its control?

Knowing tat the query of the Combo Box is based on LIKE in  its source field.

Thanks a lot.
Have been trying for ages to write to a shared exchange calendar from Access 2016. Think the problem is to do with finding the folder path/location in outlook.
Tried the following from Access button:

Sub ListSharedCalendars()
    Dim objExpCal As Outlook.Explorer
    Dim objNavMod As Outlook.CalendarModule
    Dim objNavGroup As Outlook.NavigationGroup
    Dim objNavFolder As Outlook.NavigationFolder
    Dim objFolder As Outlook.Folder
    Set objExpCal = Session.GetDefaultFolder(olFolderCalendar).GetExplorer
    Set objNavMod = objExpCal.NavigationPane.Modules.GetNavigationModule(olModuleCalendar)
    Set objNavGroup = objNavMod.NavigationGroups.GetDefaultNavigationGroup(olPeopleFoldersGroup)
    For Each objNavFolder In objNavGroup.NavigationFolders
        Debug.Print objNavFolder.DisplayName
    Set objNavMod = Nothing
    Set objNavGroup = Nothing
    Set objNavFolder = Nothing
    Set objFolder = Nothing
End Sub

Got absolutely nothing in immediate window. Nil.
Tried some code from Slipstick, hangs up and even stepping through, does not return a folder name/location or anything.
Right clicking "SHEQ" Folder properties show path as \\Admin and "when posting to this folder use IPM.Appointment. Folder name shows as "SHEQ"
Think I'm losing the plot but just do not seem able to get this one.
Any help much appreciated please.
I create small app  and I tried to connect it to access Micro Access  database but it is not connecting and always giving me this message.

inside box message     "sun.jdbc.odbc.JdbcOdbcDriver"

my code is

package ALrazi;

import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.*;


public class stu extends javax.swing.JFrame {
Connection con;
    ResultSet rs;
    PreparedStatement ps;
    public stu() {
            String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
            String login="jdbc:odbc:Db";
            //rs=sql.executeQuery("Select * from stu_table");
           // jTextField2.setText(rs.getString("Stu_name"));
        catch(Exception e)

     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
    // <editor-fold 

Open in new window

Hello All,

How can I get a running serial no. in a Sub form which is Based on a Query?

Like the Running Sum text box on a report.
Hi All,
I am running Access 2016 (32 Bit) in a multi-User environment.  My database keeps crashing because files keep getting locked.    I have it set to No Locks. It seems to work sometimes and but on the very busy payroll days it crashes frequently.  The crash usually happens when copying and pasting or deleting.  I have copied MSORUN.dll to Windows/SYSWOW64.  Because some options in the Main Menu were not linking.  Any help or idea’s would be great.
Just Needed a simple database with No server or network connected system, Just want to Add Excel Data to Access Database to make a Refugee Distribution of lets say some items. So when a refugee receives His/Her Ration they will sign and Leave. there will be about 1000 Refugees in a list and All I want is to have them sign a touch screen in access and then print the form.

Any Ideas or help to create such a Database

Microsoft Access





Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.