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

Hello, I am attempting to add vba to a command button to look at a text box and if not null, then look at a combo box. If that combo box is null, have a pop up message box and not allow the user to save the record. Since it is a continuous form and there are several records showing, it works fine on the first record, however it does not for the following records. I believe this is because I need to loop through each record. Below is the VBA I have so far. I would greatly appreciate any help regarding the loop, as I am new to VBA.

If Not IsNull(Me.Text33.Value) Then
   If IsNull(Me.Combo24.Value) Then
MsgBox "You must state if the rationale is aligned with procedures for each disputed subcategory."

'do nothing
End If
End If

Thank  you in advance,

Free Tool: Site Down Detector
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I want to click an image box on a form, find the image file and embed it into the underlying table all in one process. Is that possible?
I have a simple database that contains a couple of tables, queries. macros and modules etc.. I'm trying to make it more users friendly, so I have designed a form that loads up and will give the user the option to select an option button then the macro will run and create the report. However what I want the form  to do is to remember the last option button that was selected when the form re-opens.


I am Rupesh & I am new to this forum.

I am trying to build a tool in excel which can update database maintained in access.

There will be 3 to 4 user for this excel tool which will be connected to one access database.

The excel will act as the front end tool & access as a backend tool.

I want excel VBA to perform 3 things:

1. It will update data in access based on 2 column which will act as a unique code.
2. It will add any new row if the data doesnt match with previous unique code.
3. If the user wants to delete perticular row / range then it will be deleted from database also.

Below sample of table:

Country      Product code      Sub-Brand      Mfg Base
Russia      SRU030008869020137      Syrups      Own
Russia      SRU030008869020141      Syrups      Own
Russia      SRU030008564220158      Tablets      Own
Russia      SRU030008564220258      Tablets      Own
Russia      SRU030008564220558      Tablets      Own
USA      SRU030008869020137      Syrups      Own
USA      SRU030008869020141      Syrups      Own
USA      SRU030008564220158      Tablets      Own
USA      SRU030008564220258      Tablets      Own
USA      SRU030008564220558      Tablets      Own

1st two column will act as a unique key.

We cannot use a replacement code since there will be multiple user working on different region, replacement option can change  or erase others database.

Thanks for the help in advance.


   How to create a macro for exporting the excel data into access database. Can anyone please help me.
I have a continuous form 'Address_Pre' in my Access 2013 application.

Each line lists a subset of all of the address information for a client. (ClientName, Contact Name, address line 1, office phone, email address)

All of the text boxes are locked on form 'Address_Pre'.  

There is an 'Edit' button to the far left of each line o form 'Address_Pre'.  When this 'Edit' button is pressed the user is presented with an editable screen ('Address_Full)' containing all of the address information for the client.  Changes to any of the address fields can be made on this screen.

When the user saves the revisions on the 'Adddress_Full' it closes and they are taken back to the continuous form 'Address_Pre'.  When I come back to 'Address_Pre' I do a requery to show any information that may have been changed.

This works and the updated information is reflected on 'Address_Pre'.

The problem is that when I do the requery upon returning to 'Address_Pre', the top line of the form becomes the current line.  If the user is working there way down thru all the addresses on the form they have to arrow down to the next address they want to work on.

What I would like to have happen is:

The user presses the 'Edit' button on the twelfth (or whatever) line down from the top of the form.  They make changes and come back to 'Address_Pre'.  I want there changes to be reflected on 'Address_Pre' but I also want the twelfth (or whatever) line they were working on to be the current record …
An oldie, but a goodie.

I have created a large Relationship Diagram in Access 2013 and I do have a Cannon iPF8400 Plotter. I have set the page size to 18 x 24 C, which shows the relationship on one page; however the report will not print, as the plotter errors out. If I go into Report Design View the paper size has been truncated to 12.5 x 19.5 and the Diagram Window has been adjusted to fit to that size.

I have read this thread, Lebans and Allen Brown are no longer available.

So what are my options?
A client changed his SQL server 2008 R2 SA Password. He doesn't remember what the old password was. Now his Access application doesn't work.

We have a good backup. Is there a set of files/ folder we can restore from backup to get the old PW back? I'd really not go through the pain of doing a complete system restore.

I cannot close each pdf file separately
I am currently using the following code to pull data directly from Outlook into access:

FROM Inbox IN 'C:\Temp'[Exchange 4.0;|];

Open in new window

Instead of getting the email from my personal Inbox, however, I want this code to reference a team email box that is shared by colleagues so we can all use this tool.

The name of the account is different than just my email address so I think the syntax is more difficult to figure out:


I tried to do different variations like this and I keep getting errors:

FROM Inbox IN 'C:\Temp'[Exchange 4.0;MAPILEVEL='PGHCC Support [JRDUS]'|];

Open in new window

I know it is probably the brackets that are causing the issue... how can I make sure access knows the brackets are part of the inbox name?

Thanks for your help.

The Eight Noble Truths of Backup and Recovery
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 I want to upload my excel data file to access using button event. Below is my code.

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

        Dim Conn As OleDbConnection

        Dim Cmd As OleDbCommand

        Dim Filename As String = "D:\Ayyappan\claimDump.xlsx"



        Dim StrFileName As String = String.Empty

        Dim XLA As New OleDbDataAdapter

        Dim XLTable As New DataTable

        Dim StrSelect = "SELECT * FROM [{0}]"


        OpenFileDialog1.FileName = ""

        OpenFileDialog1.Filter = "Excel |*.xlsx|All files (*.*)|*.*"

        If OpenFileDialog1.ShowDialog() <> Windows.Forms.DialogResult.OK Then

            Exit Sub

        End If

        StrFileName = OpenFileDialog1.FileName

        Conn = DBConn()


        Cmd = New OleDbCommand("INSERT INTO claimDump([a],[b],[c],[d],[e],[f])  SELECT * INTO [Excel 12.0 xml;DATABASE=" & StrFileName & ";Extended Properties=Excel 8.0;]", Conn)


        ' Catch ex As Exception

        ' MsgBox("Some error")


        'End Try


    End Sub

While running the code I got "IErrorInfo.GetDescription failed with E_FAIL(0x80004005" this error.

Am checking my excel sheet the header name is same as per the insert statement like a,b ,c etc..

Can anyone help me on that.
I am really tired of asking users not to open file directly from the share drive as it stop updating the data from multiple sources. Is there a way I can track those users?
Hello ALL,

Is there a way to send a PDF file to the printer without opening the PDF to print it?
Thanks in advance
Trying to run a query to get total pending records up to the date of the current record

As example I have Query in MS Access where I want to find number of Records where RecDate <AppDate And RecDate >=AppDate

Goal is to determine how many records where pending at  date of Record you are on.  Attached example of data the query pulls

The code is form MS Access Build Expression that I just can't seem to get to work.  I get the total count for all the records not the count up to the record RecDate if just use "RecDate < AppDateChk"  Maybe DCount is not the way to go?

SELECT DISTINCT m.BatchDescription,m.SampleCode, m.TestCode,  m.RecDate,  m.AppDateChk, DCount("TestCode","Metric_PendRecCompQry","RecDate < AppDateChk AND RecDate >=AppDateChk") AS Expr1
FROM Metric_PendRecCompUnion m
I am automating the printing of 50+ reports to specific printers based on the report that I will be printing. The specified printer is not currently listed in my printer selection list. This is due to a thin client that upon logging in resets the list to default printers in the area. I want to automate the setup of the network printers I currently have to manually setup every day.
I have an app that writes an XML file, then FTP's it. It normally works OK but running on a different PC I get an error: -Access-Error.png
This crash seems to happen just as it starts writing the text file. Can anyone help?
I am making slow progress with my treeview. The latest problem is the first child node repeating until Access give an error 3014 'Can't Open Any More Tables'

What am I doing wrong?

Private Sub addChildren(tv As TreeView, nodParent As node, rsReqs As DAO.Recordset, lngParentID As Long)
   Dim strFind As String
   Dim strSQL2 As String

  Set rsReqs = CurrentDb.OpenRecordset("Query2")
   strFind = "HeaderID=" & lngParentID
   rsReqs.FindFirst strFind
   Dim nodX As node
   Dim strBook As String
    Do While Not rsReqs.NoMatch
      Set nodX = tv.Nodes.Add(nodParent, tvwChild, , Left(rsReqs!StockCode, 50))
      strBook = rsReqs.Bookmark
      addChildren tv, nodX, rsReqs, rsReqs!HeaderID
      rsReqs.Bookmark = strBook
      rsReqs.FindNext strFind
End Sub

Open in new window

Hi Guys,
Back again. In a bit of a steep learning curve.
At the moment I am using plain Access with no Visual Basic.
I have one query that calculates certain values, approximately 400 values in one column.
I then used DLookUp to read these values into a second query.
I then use these values to to calculate other values.
when viewing the second query it takes a very long time to display the results. (I take a walk while it is working)
I have searched Google and it seems that they do not recommend DLookUp for more than one value.
one of the ways around this is to
write a macro to make a temporary table, then update the values into a main table which is linked to the second query.
The difficulty I have is that it is not instant, it is more complicated especially when compiling the second query.
Does anyone have any advice for me.
Thanks a Lot.
(Was taught on basic then Turbo Basic a long time ago, now must learn Visual Basic soon)
Does anyone have a good link they could send me on how to set up a report that looks like a calendar?

I would like to be able to do this via queries if possible.
Free Tool: SSL Checker
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Using Access 2003 I have a 4 column page report.... I would like to add data from either another table or just in a text box at the end of the report NOT in a column.  Is this possible and if so how?

I have added a label to the report footer but its always getting pushed to another page anytime my detailed section has more than one column.  I would like to have it right at the end of the report after the detailed section.

If I set columns across then down, the report footer works great but the detailed section is too hard to read so I have to use down and across.  

Any suggestions are appreciated!
I am using microsoft 365 Enterprise E3 and i have an existing database that I would like to add the ability to link records to one note pages

I tried creating a hyperlink field in a table and added it to an existing form.

Then I opened one note and selected the page I want to link.

Then I right clicked the page and selected "Copy Link to Page"

Then I pasted the link into the field on the form, but when I click on the hyperlink I get an error message "Unable to open form" (see attached file)

Searched the web for solutions with no luck
Hyperlink Error
Hi guys,

I have a single excel file which i like to open but i am having issue when i click to open my file as i received this message below?

"We found a problem with some content in "file name". Do you want us to to try to recover as much as we can? If you trust the source of this workbook, click Yes?"

So when i click Yes - Microsoft Excel (office 365 my version) will try to recover and indeed it opens but some tabs are not there or contents or sheets (or tabs in excel). I have about 10 sheets in excel and almost all the sheets comes back with no contents.

What would be a solution to this?

i am filling a form of HPPSC, when i wants to update my information. there have a problem of range validator, what i can do?
I am a single technician managing 7 stores.
I would like to go more mobile via cell phone iPhone.

I'm looking for something that I can create my own forums and have reminders along with documents.

I'm leaning towards making my own in access however if something is better I don't want to recreate the wheel.

In addition since it's just me I don't want it to be costly since it's an employment job. They have there own software however I want to Crete my own flow and ways of doing things we are allowed to do.

Reaching out of other pros see what you use!

I have an Access split database with a form that has a record source that is a crosstab query. When I open the form and do nothing else, the query runs and populates the form, and also locks the back end. I want to leave the back end unlocked so I don't have to call everyone who may have the form open in the database and ask them to close their client before I can make changes the the back end.

How do I open the form without locking the 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.