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 using the FindFirst  method and for each  record found,
I have a list that's contain a id, first name and last name.
on click on the list it take the same id in the edit box for id
 I take an action.
It's seem, When i have the same name it take the first name .
How can i solve this problem ?

Private Sub list0_Click()

Dim rst As Recordset
Set rst = Me.RecordsetClone

rst.FindFirst "[Name]='" & list0.Column(0) & "' And [LastName]='" & list0.Column(1)  & "'"
If rst.NoMatch Then
    MsgBox "There is No Name"
End If

 If Not rst.EOF Then
    Me.Bookmark = rst.Bookmark
 End If

End Sub

Open in new window

Upgrade your Question Security!
LVL 12
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

I'm tring to merge data to word from access but word cant open the database (the database is current access db, who run the code)
here is my code.


Dim objWord As Object, strFile As String
   strFile = "C:\Users\shmulik\Desktop\test.docx"
   Set objWord = CreateObject("Word.Application")
   'open word file
       objWord.Documents.Open strFile
       objWord.ActiveDocument.SaveAs "C:\Users\shmulik\Desktop\tempDoc.doc"    'save the document
   ' Make Word visible.
   objWord.Application.Visible = True
  Dim name_db As String
  name_db = CurrentDb.Name
   Dim SQLstr As String
   SQLstr = "SELECT * FROM [details_for_reciept] where [details_for_reciept].[reciptNum] = " & Me.receiptNum.Value
objWord.ActiveDocument.MailMerge.OpenDataSource _
      Name:=name_db, _
      LinkToSource:=False, _
      Connection:="QUERY details_for_reciept;", _
   ' Execute the mail merge.
   'objWord.Close True
   Set objWord = Nothing
I am trying to take a form, create a query from entries on the form, create an Arraylist from the query results and then compare that Arraylist to a Collection of objects to see if a member of the collection (with an attribute of same type as Arraylist) is on the Arraylist.  Is it possible to do this in Access?
Hi, can anyone please give me some information on the following:

I have an Access 2013 database and I want to be able to export my reports and save (and link) to SharePoint. Is this possible? I have very (VERY) limited knowledge of SharePoint.
A Problem with MS Access 2016 Navigation forms.
Navigation buttons fail to "de-highlight" when I move to a different button.
Only when I hover over the previously selected button, does the highlight disappear .
See this video link for clearer explanation:

I have a macro that exports a table to an Excel file.  The action in the macro is called ImportExportSpreadsheet.  Every time I run the macro, it just adds another worksheet to the file.  I want it to completely overwrite the file instead.  Is there a way to do this?

Simple export code with perplexing error.

My MS Access database refuses to export all of a series of queries as pipe-delimited text files. At first it was giving me an error message saying "...database engine could not find the object..." and then naming the object but replacing the period/dot (.) before the file extension with a pound/number sign (#). After I imported all db objects into a clean database with and recreated the import specs the # disappeared, but the error message remains.

The queries are all virtually the same, just filtered differently. I tried creating multiple Export Specs, but that only had limited success. I've tried shortening the names of the queries and exported files - nothing. I've tried creating a table with the same name from each query and exporting that, deleting it and re-creating it with the new set of data - zilch. I've artificially created the files. The database deletes it and then exports a new version - or doesn't. I have full access to the server and folder, and the same error occurs (sometimes) even when I test on a local folder on my laptop. I even tried removing all the underscores from the query/file names, but it didn't make a damn bit of difference.

I'm at a complete loss. There are no periods/dots in the file name, only in the *.txt part.

Basically, the export line is, in essence, this:

     DoCmd.TransferText acExportDelim, "ExportPipeDelimited", "File_Name", "C:\Folder\File_Name.txt", False

ANY help would be …
I am basically wanting to Quit Access on PC2 from PC1 by using VBA.  This is to keep 1 user logged into only 1 computer at a time.  I have a table which keeps track of which PCs the user is logged into and if the user tries to log into PC1 when they are still logged into PC2 then I want the VBA to Application.Quit the access on PC2 before logging into PC1. I have everything up until this Application.Quit done.

So how would this go?

Thanks for the help.
I am working on query that pulls data from OPM_Table based on a combo box by location.  I have another combo box that selects grade by OPM_Table.Grade2.  I have already created SQL for a single grade.  The attached code I created makes the drop down select the grade I need:  (OPM_Table.GRADE2)=Forms![Fee Review Summary]!Combo137)
However, there are times when we have GS-5/7/9 where that does not exist in the OPM_Table.  I need to figure out how to write a query that selects GS-5 Annual 3 for FY 2019, GS-7 Annual 1 for FY2020, GS-9 Annual 1for FY2021, GS-9 Annual 2 for FY2022, GS-9 Annual 3 for FY2023, and GS-9 Annual 4 for FY2024.  I know I need to do a If, then else statement, but I can't figure out how to do it.
i need to take the particular zip files in four folders and save it outside of the folders.
anyone help me for the code in batch files.

thanks in advance
The new generation of project management tools
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.


I want to use Access VBA code to generate a report called "Invoice" and automatically convert it to a PDF and save it in a specified folder with a different name.

What VBA code would I use?
In Access 2013 I am trying to import a comma separated text file.  The first row will not import, I get Type conversion Failure.  But when I do it manually using the wizard I have no issue.  Here are the first few "columns" in the text file:

Data Filename,Sample Name,Sample ID,Androstenedione,Androstenedione 13C3,Cortisol,Cortisol D4

Yes those are headers, but they can change with every file so I feel it would be easier to just import them as regular data and deal with it with some programming. The first 3 "columns" work fine, but after Sample ID none of the others will work, they all get the Type Conversion Failure.  I checked the table and all the fields are Short Text.

 Here is the vba line:

DoCmd.TransferText transferType:=acImportDelim, SpecificationName:="", TableName:="NoPound", FileName:="C:\OMNI LIS\Preconversion\NOPound.txt", hasfieldnames:=False

Does anyone have any idea why the manual way works but the vba does not?

I am looking for a function to open a popup  form over a control in ms access VBA.The function should work on the monitor that has the ms access application( either monitor one or monitor two). windows 10 64bit and Ms access 2016 64bit
I have a main form with a sub-form which is a continuous form.  When the main form opens, the sub-form's first record appears to get the focus and I don't want any of the records in the sub-form to get the focus.  I do have the tab order established on the main form.  And in the sub-form, I have the field that is getting the focus set to tab stop = no.

How can I make the sub-form field not appear to have the focus?
I need to cancel a report print when I get an error in the OnFormat section of the report.  The particular error is 2100 "The control or subform control is too large for this location."
Any help greately appreciated
Many thanks
D THomas
Greetings Experts!

I had a custom website built months ago that ran on a SmartTV as an info kiosk (Running webpage in Chrome kiosk mode). It was coded to refresh every 10 mins and pull info from an Access database.

Then the IT department decided we can't do that anymore. They removed Chrome from all systems (so that we can't use apps), blacklisted my website and then locked both the SmartTV and computer from getting internet access ugh!!

I was told to use a looping PowerPoint presentation (boring!). I need to show current data pulled from my MS Access database and PowerPoint has to be opened/closed to refresh links. I asked IT if they could make a batch file to open/close the presentation and they said no that it violated IT policy. I don't even have access to the cmd prompt or powershell. :(

There is a third party program called DataPoint designed to do what I want but guess what? Nope! We can't use it. It's not approved by IT and we have no admin rights to install any third party solution to help with this.

Does anybody have another solution?  Maybe use VBA to refresh the PowerPoint links?

I'm having an Access FE with Sql server 2014 BE. when adding a record via ADO and trying to Retrieve the Identity ID I'm getting An error "Record is deleted"
as per my research it has to do with having a trigger "For Insert" but the trigger is only adding a record to a unrelated table, so i'm not sure what's going on over here.

ALTER TRIGGER [dbo].[billingPay.Insert]
    ON [dbo].[BillingPay]


	INSERT INTO [dbo].[Transactions]

		select BilingPayID,'Payment',getdate(),[Amount],[Amount],Rep,CustomerID from inserted

	--EXEC UpdateCustomerBalance @CustomerID

Open in new window

please advise
I would like to have a particular field in a Access form require a password to make an entry.  How to implement?
I'm using MS Access 2K and my staff occasionally enters too much data for a specific record.  I suspect the max record length for a record is being exceeded, however, a problem does not show up until the employee runs a query to append the table to a table on the back end.

Access fails when the append query is run and produces a "record too large" error, without any indication of which record has failed.

The table being appended may contain 50K or more records, so we need a programmatic way to identify the record that is too large.

I believe the max record size for Access 2K is 2018 without Memo fields but I'm not sure what that means.  For example, how many characters are in a double field, date, etc?

Can anyone help?
Never miss a deadline with
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

I have created a database managing hosts at my firm. All hosts have an IP address. They are formatted as such > ***.***.134.*** OR ***.***.135.*** OR ***.***.196.***. At the top of my form I have buttons so if the ***.***.134.*** button is selected, the next available ***.***.134.*** address would populate. Similarly if I chose ***.***.135.***, the next available  ***.***.135.*** would show, and then I could fill in the other fields (host name, make/model .etc.) and then save the record. How could this be done where the IP Address text box would auto populate depending on the button I click at the top of the form? Thanks!
I created an application using visual 2017 and MS Access and was working fine in Windows 10. But when I created an installer and installed in windows 7 pc, I encountered an error "Operation must use an updateable query" and cannot update the information.
Kindly advise
I am working on a MS Access form. The form's record source is a query. There is a calculation that occurs at the query level. I want to SUM all these calculated rows in the form header and all I get is #Error. How do I resolve this?
The system i am using is Windows 2012  R2.  So when trying to create an ODBC DSN to a MS Access DB, and using 64bit ODBC Admin, there is no MS Access driver to select.  If I use ODBC 32 bit admin, there is a MS Access driver to select.  But after selecting that 32 bit MS Access driver, this error msg appears "Failed to connect to link .... [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application".  Is there an OBDC driver update for the 64bit Windows system that solves this issue?  I looked but couldn't find anything that said for Windows 2012 R2 system.  Any suggestions would be appreciated.  thanks.
Hi all,

I have an olderAccess front end with SQL backend. So far there have been no issues.
But, i have a need to find a way of converting and inserting a standard windows bitmap as an OLE Device Independant Bitmap directly into the SQL database which had an image datatype so the the Access front end can display it.

Primarily i'm developing with PHP with a view to replacing the older system & this is likely to be a temporary solution.
I've tried a program called ImageMagik which can convert into the DIB format but does not seem to be right for teh Access front end to display.
My gut feeling is that I may have to try and create some VBA that can take the file/filename & insert it into the database.

I've had a look around the web site and couldn't really see any suggestions & searching the web hasn't really helped.

I'm asking to see if there are any suggestions or if this is a bit of a non starter?

Can a spreadsheet be imported directly into a SQL table from a Stored Procedure?

I am trying to automate a conversion of a cient's legacy data.  Their data is supplied in different formats, one of which is a spreadsheet.

Some of the data is in fixed length text files and I am using SQL bulk copy to load them.

I am fairly new to SQL Server and wonder if there is a way to import a spreadsheet directly into a SQL table from within a stored procedure.

I am currently importing the spreadsheet directly into an Access table but that is way too slow.

I created the table in SQL by importing the MS Access table that I'm currently importing the spreadsheet into.  I don't know the mechanics of importing the spreadsheet or even if it is possible.

This is the table definition:
CREATE TABLE [dbo].[Balance_Work](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[SkipOrig] [nvarchar](255) NULL,
	[Skip] [nvarchar](255) NULL,
	[LegalFlagC] [nvarchar](255) NULL,
	[TaxType] [int] NULL,
	[BlockLot] [nvarchar](255) NULL,
	[TieBreaker] [nchar](10) NULL,
	[Full_Int_Add_TypeID] [int] NULL,
	[SequenceNo] [int] NULL,
	[Priority] [float] NULL,
	[MuniCode] [int] NULL,
	[Owner] [nvarchar](255) NULL,
	[Addr1] [nvarchar](255) NULL,
	[Addr2] [nvarchar](255) NULL,
	[Addr3] [nvarchar](255) NULL,
	[Year] [float] NULL,
	[EnterDate] [date] NULL,
	[IntDate] [date] NULL,
	[Face] [float] NULL,
	[Penalty] [float] NULL,
	[Interest] [float] NULL,
	[Cost] [float] NULL,
	[Comm] [float] NULL,

Open in new window


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.

Vendor Experts

Gil FeldmanMonday Learn more about Monday