ms-access-query

How To Escape Apostrophe In SQL Update Query

If you are looping a table with thousands of records, you’ll probably run into at least one that has an apostrophe in the field name. Like “Mike’s” or “M’cormick”, or something else. Anyway, here is one way to escape the string when you are doing your update query. Option Compare Database Sub YDriveLoop() ‘4/23/24 erik@loeblcomservices.com […]

Continue Reading

How To Parse A Flat File In Excel VBA

In another post I demonstrated how to access a file on your computer using the MS Office Library. Here it is if you don’t know what I’m talking about. In this post, I am going to show you how to access the file and load it into your spreadsheet. I will do the same thing […]

Continue Reading

How can I interact with other Office applications (Excel) using VBA in Access?

Need to write your Access data or query to an Excel file? Here is the how to do it: Most people are familiar with Excel and know how to use it well (enough), and when you start talking about Access, they get scared off, and don’t know what to do anymore. Well, here you are […]

Continue Reading

How To Create A Parameter Query In Access

A parameter query changes your ordinary static access query to be more dynamic and interactive. It will ask you a question about what you want to search for, allowing you to do a search query multiple times instead of just once. You can do your parameter query straight from the QBE (Query By Example) Editor, […]

Continue Reading

What Is Microsoft Access Used For?

To those of you who are asking the question of “What is microsoft access used for?” , here is my opinion. I’ve been using this program for well over 15 years, and it’s become fairly easy to deal with. Many people feel that it is hard to work with, but that’s not my experience anymore […]

Continue Reading

How To Make An Access Select Query

Hi everyone, This is not really a VBA item, but it’s important and you will need to understand this concept when you are creating your SQL statements in VBA. In our example we have a table called “Customers”: Now we just want the customers from “London”. So we set up a select query to select […]

Continue Reading

VBA Building Dynamic SQL

This video example is going to show you how to generate a SQL string from a form in VBA. [sourcecode language=”vb”] ‘======================================================== ‘DATABASE DESIGNED & CODED BY LOEBLCOM SERVICES 2013 ‘ERIK LOEBL(713)409-7041 ‘EMAIL: erik@loeblcomservices.com ‘WEB: http://loeblcomservices.com ‘======================================================== Option Compare Database ================ form: ================ Private Sub btnFindStocks_Click() Dim strWhere As String Dim strSQL As String Dim […]

Continue Reading

Excel VBA Read Text File

So how can you import the contents of a csv or text file into your Excel worksheet: Find out: ‘======================================================== ‘DESIGNED & CODED BY LOEBLCOM SERVICES 2013 ‘ERIK LOEBL(713)409-7041 ‘EMAIL: erik@loeblcomservices.com ‘WEB: http://loeblcomservices.com ‘======================================================== Sub query_text_file() ‘PURPOSE: Query A Text File ‘************************************* ‘clear ‘Text File Contents’ worksheet ‘************************************* Worksheets("Text File Contents").Select Range("A2:K6500").Clear ‘************************************* ‘now populate […]

Continue Reading

VBA Read Excel File

Here is a question I received “Thanks for the video, I have a question.How to read from a group of closed excel files searching for a certain value in say column F then if that value is found then copy that row to a workbook and continue search for then next value ” So I […]

Continue Reading

MS Access VBA Form Filter Example

In a previous post I gave an example of a MS Access form filter. This revision is to demonstrate how to requery a form after the combobox changes, and not when a button is clicked. Here is the code: Private Sub cboDescription_AfterUpdate() Me.FilterOn = False m_Where = m_Where & ” AND Description = ‘” & […]

Continue Reading