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 am trying to run some simple API calls to Jet.Com to first get my token and then publish some product I have for sale. I am using Access 2013 and I am getting close, but know I am leaving our some import information possible regarding the header or XML format. Below is my code and any help would be appreciated. Please forgive my lack of detail in the code, but with a little help I believe I can lean it. See code below:

  strURL = ""
    strURL = strURL & "User=" & JetAPIUserKeyTest & "&pass =" & JetSecretKeyTest '& """" ''" '" '& "}"

    Dim htm As Object
    Set htm = CreateObject("htmlFile")
    With CreateObject("msxml2.xmlhttp")
       ' .Open "GET", strURL, False
        .Open "POST", strURL, False
        Response = .responseText
     End With
Thank you
I'm struggling with a label report in Access - A4, 2-column, 105mm x 74mm, no margins. Everything line up nicely when printed directly - when using the built-in PDF export, it's like some margins are Applied and everything is no long in its place when printed from the pdf - I've done numerous Little adjustments to try and correct it, but with no luck so far. Please advice :) It's the same result when run from another system.

DoCmd.OutputTo acOutputReport, rpt, "PDF Format (*.pdf)", strPDFTmp, False

Open in new window


When I try to format data set on excel sheet using below MS Access VBA script, I am getting run time error 1004, "Unable to set the HorizontalAlignment property of the Range class.

Public Sub North()
Dim ObjExcel  
    Set ObjExcel = CreateObject("Excel.Application")
    ObjExcel.Visible = False
    ObjExcel.Workbooks.Open "C:\aa\bb\North.xlsx"

    Set ObjSheet = ObjExcel.ActiveWorkbook.Worksheets(2)

         ObjSheet.Range("1:1").HorizontalAlignment = xlCenter
         ObjSheet.Range("1:1").VerticalAlignment = xlCenter

Please have a look

Thank you
I am looking for advice on how to optimize my code.  It is working now, and happily generates the output shown-- but at this moment, I've only written four levels.  I need ten total, and it seems to me that I should be able to reuse the lines of code by passing them different values, depending on what part of the hierarchy has focus at any given time.

This is the code that I would want to re-use;  XX and YY would be replaced by integer values:

    If DCount("*", "HSTProductionReportTb", "ManagerID = '" & rsYY.Fields("EagentID") & "'") > 0 Then
        Set rsXX = db.OpenRecordset(strSQL & XX & " and ManagerID = '" & rsYY.Fields("EagentID") & "'")
        Do While rsXX.EOF = False
        strInsertSQL = "Insert into HSTProductionHierarchyTb (AgentNa, EAgentID, NAPXX, TeamNAPXX) select '" & rsXX.Fields("AgentNa") & "', '" & rsXX.Fields("EagentID") & "', '" & rsXX.Fields("NAPSum") & "', '" & rsXX.Fields("TeamNAPSum") & "'"
        DoCmd.RunSQL strInsertSQL
    'Insert Next-Level SubordinateCheck here
'end of LevelXXCheck:
        Set rsXX = Nothing
    End If

I'll be grateful for any advice or recommendations.  :)


Example of formatted output

Private Sub btn_Hierarchy_Click()
'loops through the Production table, selecting the top-level manager, that manager's subordinates, and so on down the chain
'names, IDs, NAP, and TeamNap are inserted into a 

Open in new window

Is it possible to grow a text field on a form?  I know you can on a report but I don't seem to be able to make it happen on a form.
I have a query that lists last names of people.  But I need to show them on a form with the names followed by a comma and a space.  So for example... Steve, Bill, David, George, Susan, Martha, etc.  How can I do this?
In open office how to insert one shape inside other

as attached i have big rectangle
I like to insert small circle into that rectangle
how can i achieve it

please advise
visio 2013 standard i opened blank diagram,

I do not see any shapes like circles, rectangles, person, arrows etc on the left hands side

how to enable them and keep them there all the time so that whenever i open visio i can just drag and drop and make the diagram
please advise
I am having an issue when exporting Access Reports to PDF.  I am using the 'DoCmd.OutputTo acOutputReport, stdocnameTrend, acFormatPDF, FileNamePDFDets, , , , acExportQualityPrint function.  

The function is working however when I open the PDFs not all of the images are showing, I have looked at the "Display When" and they are all set to always.  When I print to pdf it works, but I can not find the code to automate printing to PDF...

Anyone have any success with this?
i see some templates here.
i downloaded zip and unzipped and copied those contents and placed at
C:\Users\xyz\Documents\My Shapes

any other visio similar templates to reuse existing shapes and sequence diagrams etc

please advise
I am trying to list files from folder\subfolder from this sharepoint folder.
SharepointAddress = " Set Up Templates/"
I would like to do this from a button on a form and put the information in a table for exporting.
I have never done anything like this before thru a network except normal dir stuff.
Does anyone have any code that can help me do this. I would greatly appreciate it.

I am trying to automate report (excel spreadsheet) production using access vba script and windows task scheduler.
I am getting error message at beginning of the scripts itself(given below).

SetAttr "Z:\Report_New.xlsx", vbNormal

(because I apply SetAttr "Z:\Report_New.xlsx", vbReadOnly at the end of all scripts.)

"Z" is a mapped shrepoint drive. The run time error 75 tells Path/File access error. But when I run the script manually there is no issue. When I left it to run over night, vba editor throws this error message.

Please let me know  if you have any suggestions
Thank you
Can't load any active x objects
Hi Experts,

I have a SQL view that is being linked to my Access app.
That view has a column named SNVNum, defined as follows
CAST(REPLACE(dbo.Skilled_Nursing_Visit_Note.SNV_ID, 'snv', '') AS int)

Open in new window

Now when I open the view and sort by that column it works perfectly fine in db container.
it also works fine when running the following in SSMS.
Select * from vw_SkilledVisitNotesFilterFrm Order by SNVNum

Open in new window

However when I assign the form the following SQL as record source.
        Me.RecordSource = "Select * from vw_SkilledVisitNotesFilterFrm  Order by SNVNum"

Open in new window

it gives me the error attached.
Hello Experts!

I'm running a Access 2K app that runs perfectly on XP-Pro computers with 2GB of memory on an WIn10 Machine using MS Office 365.

When I attempt to run a query with 800,000 records I am getting an Memory Resources Exceeded message and system operation fails.  I need to use task manager to get out of the loop.  The same query works fine if I perform a reboot and run the query as first-thing.

I'm obviously running out of something, but what?  Is it system memory, hard drive space, temp file?  What can I do to get this query fixed?

Thanks in advance!

The screen is Shrinking when run my app on laptop always. So it won't show the bottom part of application on the laptop screen. Look my images may it will clarify my problem.
please help me.
screen One, is what should I see.
screen One what should I seeScreen Two, what happen when I run my application on a laptop, where you can see the buttons down in the form is not shown
screen Two
I want to write a vba macro that does the following

link a table from sql server to access database, embed/program and execute access query in vba and remove the linked table

My code so far is this.

Sub Update()
Dim Con       As ADODB.Connection
Dim RS        As ADODB.Recordset
Dim myCommand As ADODB.Command

Dim AccessFile As String

Set Con = CreateObject("ADODB.Connection")


'AccessFile = Range("b3").Text & "\" & Range("b4").Text & ".accdb"
AccessFile = Range("b3").Text & "\" & Range("b4").Text & ".mdb"

With Con
  .Open "Provider = Microsoft.ACE.OLEDB.12.0; Data Source=" & AccessFile
End With

'cn.Open "Provider=Microsoft.ACE.OLEDB.12.0; " & Conn

Set myCommand = CreateObject("adodb.command")

''************ link table dbo_production_values from a sql database somewhere on the network                 <-----------------------

With myCommand
    .ActiveConnection = Con
    .CommandType = adCmdStoredProc
    '.CommandText = "qry_Daily_Production"
    .CommandText = "SELECT AC_PROPERTY.propnum, Prod.client_day, Prod.allocated_oil_production, Prod.allocated_water_production, Prod.allocated_gas_production, _
    Prod.api FROM AC_property INNER JOIN dbo_production_values AS Prod ON AC_property.api=prod.api WHERE prod.client_day >= DateAdd ("d", -300, Date());""
   '.Parameters.Append .CreateParameter("paramDateInput", adDate, adParamInput, , Sheets("DataEntry").Range("D5").Value)
    Set RS = .Execute()
End With

Open in new window

''************ deink table dbo_production_values from a sql database somewhere on the network                 <-----------------------

' continue with your checks if rs is empty etc.
End Sub

Please help me with the syntax..

Thank you.
What are the known problems when upgrading an old ms access database to ms access 2016?
Microsoft Access 2016 application:  OS Windows 10 Pro

I have a form which I will call frmForm1 (Single form NOT Tabular form) in which I need to display an image (picture) originating from a file called ABC.jpg.

Of course I could embed the image in a field of the underlying Table (tblTable1), but that would make the table occupy an unmanageable amount of space if the number of record grows.  Typically the underlying table contains about 10 thousand records with about 50 fields.

What is the recommended method to accomplish this goal.
I have a function in Access to retrieve some data from a web page. I need to get the correct syntax to access the next page of the process.

This is the code that I'm currently using that is not working.
   Set lnk = QPR.Document.Links(1)    ' 3=TMMK-VEH,4=TMMK-PWT,5=TMMC,6=TMMTX,7=TABC,8=NUMMI,9=TMMI,10=TMMBC,11=TMMAL,12=TMMNK

Open in new window

I believe the target page has been changed.

This is the source code of the page. I need to to click the link that is labeled "TMMK-VEH".
	   <title> Supplier Key Performance Indicators</title>
	   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	   <link href="theme/Master.css" rel="stylesheet" type="text/css">
			function hidestatus() {
			    document.status = '';
			    return true;
			if ( document.layers ) {
			    document.captureEvents( Event.MOUSEOVER | Event.MOUSEOUT );
			document.onmouseover=hidestatus; document.onmouseout=hidestatus;
		<script LANGUAGE="javascript" SRC="include/actionSubmitter.js"></script>
  		<script charset='UTF-8'>

			var environment = "prod";
					window['adrum-start-time'] = new Date().getTime();
					    config.appKey = 'AD-AAB-AAH-WRX';
					    config.adrumExtUrlHttp = '';
					    config.adrumExtUrlHttps = '';
					    config.beaconUrlHttp = 

Open in new window

I have a 10 year old Access function that logs into a website and navigates to a search form and downloads data. However, the website has now changed and the function is useless. This site helped me create the code that has worked for many years. Basically I need help again. Unfortunately, I have forgotten many of the key points to the design of this function.

I am getting a
Run-Time Error '2147467259 (80004005)':
Method Busy of Object Webbrowser2 failed

In the past the browser would open the target page and enter my user name and password and login to the site. Currently, this is where the step is failing. Private Sub Command155 is where users would input their username, Pass word and date range that would be applied later in the procedure.

Private Sub Command155_Click()
'Assign the user inputs to variables that will be used in the Web application.
'Tell VBA what to do when the user does not input a date format
On Error GoTo NotADate

    myStartDate = Format(CDate(txt_StartDate), "mm/dd/yyyy")
    myEndDate = Format(CDate(txt_EndDate), "mm/dd/yyyy")
    myNAMC = txt_NAMC
    myUserName = txt_UserName
    myPassWord = txt_Password

    'Inform the user that this program is operating correctly.
    'MsgBox "Please wait, SKPI is updating!"
    ' I am just testing my variables here, this will be eliminated later.
    MsgBox "Start Date:" & " " & (myStartDate) & "   " & "End Date:" & " " & (myEndDate)

Open in new window

My problem involves rogue page breaks. I'm using MS Access in Office 365. I have an application that creates legal documents for 15 different states. The application has seven base reports from which to build these documents. Because of the various states boiler plate,  page breaks occur at different places. I need to force page breaks in order to keep paragraph headings with at least one line of the corresponding paragraph.

All seems to work well accept when developing about the 10th state, the last page break creates multiple page breaks instead of just one as expected.  The total page breaks in a report is between 12 to 18, although each state uses no more than four or five.

Once the "seal" on this issue is broken, then all of the reports have the same issue, even prior reports that had been working.  I'm wondering if I should re-install MS Access? Perhaps one of the MS Access system files has beeen corrupted?

Any thoughts?
I'm currently trying to print out PDF files in a folder on my c drive,I thought it'd be smart to put all files in a printing queue, and then print them all in one go. Is this in any way possible with VBA?
I am trying to avoid looping through the folder.I cam manually copy and paste them in the print queue but I am trying to avoid doing that also.
Access Database error... cannot open database.

Message says "The Microsoft Access Database Engine stopped the process because you and another user are attempting to change the same data at the same time"

I have searched for database lock file (*.dbl) but cannot find one. The backup file that we have available gives the same error.  Can someone please help?  Cannot repair because I cannot open the database.

Using Access 2007 (have tried to open a copy with Access 2016 but get the same message).
I am getting the below erro with MS access.
error message not available. Result code

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.