Skip to main content

Questions tagged [ms-access]

Microsoft Access, also known as Microsoft Office Access, is a database management system from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software-development tools.

Filter by
Sorted by
Tagged with
12 votes
3 answers
1k views

Security issues in a SQL query and possible function?

By adding more and more features to my websites, I am now up to 7 different hard coded queries. I have read a lot about SQL injections and possible flaws and security issues, and wanted to make sure ...
Sifu's user avatar
  • 263
12 votes
1 answer
5k views

Creating ShortCut (RightClick) Menus in Access

I'm writing a tool to create shortcut menus for an application that I maintain built on the Access runtime. I compile this app into an *.accde file, so much to my chagrin, all right click menus are ...
RubberDuck's user avatar
  • 30.8k
11 votes
1 answer
31k views

Form controls - Single event handler for multiple controls, without sacrifices

Bit of background info first - I've been struggling with a problem for a while now. How could you have one single event handler to handle every control (or all of a particular type of control) on a ...
Kai's user avatar
  • 449
11 votes
0 answers
2k views

Function to conect to Firebase Rest API via Access VBA

This is the application for small school, which will store students' info in Firebase and also retrieve data from Firebase. I am using JSON Parser to parse the data and save the same in Access tables. ...
Adarsh's user avatar
  • 259
8 votes
2 answers
1k views

Generating a collection of controls

This question I asked previously mentions a function named BuildControlCollection, which I didn't go into the details of since it wasn't relevant. However, because ...
Kai's user avatar
  • 449
8 votes
2 answers
3k views

Overriding all Access form control AfterUpdate methods

I have a set of custom event handlers for all my textboxes and combo boxes. The reason for this is my users want the bound form (to SQL Server) to immediately push changes to the recordset, rather ...
enderland's user avatar
  • 1,726
7 votes
3 answers
458 views

Update 12 records in a database table in less than 13 queries

I've got a database table in my application called "periods". The structure of the table is: Year (Number) Month (Number) Period (Text) The Year column stores years (Say, 2016), Month stores months (...
David's user avatar
  • 173
7 votes
3 answers
7k views

Progress Bar Form

Forms in MS Access are really just special glorified classes, so you can create new instances of them from code like this. ...
RubberDuck's user avatar
  • 30.8k
7 votes
1 answer
351 views

Add Default Rubberduck VBA Folder Annotation to VBProject.VBComponents

Currently Rubberduck VBA files all the VBProject VBComponents in that do not have a Folder Annotation in a Folder named after the VBProject. It can be time consuming to manually organize the ...
TinMan's user avatar
  • 4,143
7 votes
2 answers
3k views

Sending test emails to a list of email addresses

I've made the following program that takes a list of email addresses from a table in MS Access and sends each a test email. ...
Katana24's user avatar
  • 327
7 votes
1 answer
747 views

MS Access to PostgreSQL converter

I was hoping to get some feedback on the implementation of this class for programmatically converting an access file into a PostgreSQL schema (works by obtaining schema data from the cursor object). <...
Nicholas Clarke's user avatar
7 votes
1 answer
555 views

Creating dialog with Access form instances

With Access forms, creating a true dialog form -- in the sense of actually pausing execution of the calling VBA code -- with only instances (rather than using global default instances) is a ...
this's user avatar
  • 2,029
7 votes
1 answer
3k views

Run arbitrary INSERT INTO SQL Query using parameters

While DoCmd.RunSQL is all well and good for simple code, the number of times I've run into problems with unescaped apostrophes and the like was starting to nark a ...
Aiken's user avatar
  • 171
7 votes
1 answer
169 views

Split cells vertically on comma

This takes a field delimited by commas, and splits on the comma. The newly divided information is put in another field (created at the start of the program) called ...
Paradox's user avatar
  • 173
6 votes
1 answer
3k views

Retrieving ListBox.column values and store into objects

I know there must be a better way to perform the above sub than using multiple If statements. I was thinking of storing the ...
Jabberbyter's user avatar
6 votes
2 answers
157 views

Automated document downloading, with error handling

I've automated downloading of CSVs from our vendors' websites. As expected with anything web-based, things can go... wrong, so I'm implementing some better error handling. The code has been working ...
FreeMan's user avatar
  • 1,290
6 votes
2 answers
188 views

Retrieving database values through properties

I have a Settings table which I make frequent DlookUp calls to retrieve values. So I thought instead of having to write ...
Kostas K.'s user avatar
  • 215
5 votes
6 answers
3k views

Using OLEDB to connect to a MS Access 2007 file

I am working on a program which use OLEDB to connect to a MS Access 2007 file. My program has a possibility to add and delete records from file by using SQL statements which select deleted item by ID. ...
HelpNeeder's user avatar
5 votes
2 answers
5k views

MS Access VBA code to compare records in a table and combine data where necessary

I need to process some data which is the output from a CAD system, namely a Bill of Materials. I've constructed database and written some VBA code to achieve this. An explanation of what this code ...
WhatEvil's user avatar
  • 203
5 votes
1 answer
5k views

MS Access VBA code to compare records in a table and combine data - revised

I've previously posted a version of this code here: MS Access VBA code to compare records in a table and combine data where necessary To repeat what I'm looking for from my previous post: Note I ...
WhatEvil's user avatar
  • 203
5 votes
1 answer
245 views

Truncating long strings when saving inventory items to database

To test incoming data for string values that are too large for the "database" (MS Access), I could do this: ...
B. Clay Shannon-B. Crow Raven's user avatar
5 votes
1 answer
2k views

Speeding up Access query with a calculated field calling a VBA function

At work I have a Microsoft Access database of employees with fields such as employee's manager, employees email, and employee ID. My duties include updating this database and validating entries ...
Anthony's user avatar
  • 151
5 votes
1 answer
9k views

Resizing the controls on an Access form dynamically

Below is a sub I wrote to dynamically resize all the controls on a form. It utilizes the Tag property of each control. In that ...
BarrettNashville's user avatar
5 votes
1 answer
517 views

VBA to MS-Access SQL query set(s) and outputs

I am hoping I can get some guidance on some better "best practice" suggestions on how to handle this kind of code set. I understand that parameterized queries are a thing, but I am not quite there yet,...
Doug Coats's user avatar
5 votes
0 answers
2k views

Object-relational mapper for VBA / MS-Access

This is my attempt to create simple object-relational mappers (ORM) in VBA for DAO and ADODB recordsets to reduce boilerplate code when converting data between recordsets and objects. As far as I've ...
FolkCoder's user avatar
4 votes
4 answers
863 views

Adding entries to an MS Access file using OleDB

In the following piece of code I am adding entries to an MS Access file using OleDB. The purpose of this post is to point out my bad programming practices and if I have created any security flaws here....
HelpNeeder's user avatar
4 votes
4 answers
3k views

General function to test for empty/no-value controls

I'm working on a very CRUD-heavy MS Access application, which has over 50 forms for entering and working with data. This, of course, involves lot of testing to see if a textbox, recordset, etc. has a ...
DataWriter's user avatar
4 votes
1 answer
97 views

Python SQL insert to MSAccess with VBScript

I have a business use case that required running SQL insert queries to a local MSAccess database with a Python script. The actual script does many other things and the SQL function is just one of them,...
spaghetticode's user avatar
4 votes
1 answer
370 views

Improving performance of VBA data validation script in Access with large data size

I work in IT compliance and one of my main duties is ensuring the integrity of employee network accounts. Partial VBA script as currently used is shown below: ...
Gregory's user avatar
  • 41
4 votes
2 answers
663 views

Recursive function designed to ensure that full folder path exists before copying a file to the location

My recursive function works, but I feel it could be improved... suggestions? The code ensures that a given folder path exists by checking its validity or creating them if they don't already exist, so ...
rohrl77's user avatar
  • 181
4 votes
1 answer
336 views

Parameterized Query in Access SQL

I am a beginner in Access SQL. I am in need of writing a parameter query for Access SQL and found a few tutorials and links for that but that wouldn't satisfy my requirement. DB: Access DB This ...
RanjithKumar Govarthanan's user avatar
4 votes
1 answer
127 views

Slow performing subquery

This query executes very slowly and I wonder if it can be improved? We have an Access database split to front end / back end with around 50 users. BE is in a network folder and FE is on users' hard ...
Absinthe's user avatar
  • 186
4 votes
1 answer
65 views

Time spent by product in process represented by clockin and clock out

This is the code I wrote to find out the time spent by product in process represented by clockin and clock out. Time stamps X and Y (for example, 7/23/2013 7:00 AM and 7/23/2013 8:00 AM) reflect the ...
user2615998's user avatar
4 votes
0 answers
70 views

Edit Excel through MS Access

I have an Access macro that runs AfterUpdate of a form. It opens an Excel workbook and edits a few cells. I have It working the way I want, but the problem is that ...
Bread Doughlas's user avatar
3 votes
4 answers
136 views

A function that implements a query

I have some parameterized queries in Access 2010. They are often used in VBA functions having the same parameters. In such cases, I give the query and function the same name. The following is such a ...
Martin F's user avatar
  • 149
3 votes
3 answers
363 views

DAO recordset effiency

I have a form that consists of about 60 fields that all update when choosing a different customer from a drop down. I feel like my current way is not the best way as it takes about 30 seconds to ...
mrbungle's user avatar
  • 183
3 votes
3 answers
187 views

Code conversion from Access to T-SQL

I have an Access database that I'm converting to SQL Server 2008. One of the queries in the database uses the LAST function. The table has a AutoNumber ID so true order is simple. ...
Dave's user avatar
  • 143
3 votes
2 answers
2k views

C# Datagridview to Access database

I feel like there would be a better way to this. Essentially, I am transporting the data from an excel file to a DGV, and then from a DGV to an Access database. Should I cut the middle man or is this ...
Avan's user avatar
  • 291
3 votes
1 answer
111 views

Automatically generate a thunderbird importable contacts file for all employees

This is implemented in Ms Access 2003. The Table "People" is a ODBC linked database table on a MSSQL 2008 server. The file generated can be imported into Mozilla Thunderbird contacts to have a contact ...
Magisch's user avatar
  • 330
3 votes
1 answer
2k views

Update pass-through query from a form (an alternative to stored procedures)

I've adapted a script from the book Microsoft Access Developer's Guide to SQL Server that I use to update a pass-through query via a form. One way to pass parameters to a pass-through query is to ...
User1974's user avatar
  • 198
3 votes
1 answer
5k views

Generic database select method for within my application

I want to implement a generic Get method for my ASP MVC application, which gets data from an MS Access database. This is what I have so far, where I am testing it ...
Bassie's user avatar
  • 559
3 votes
2 answers
130 views

Updating access records

I spent an hour or so this morning compiling this, and since I have started reading Clean Code and The Pragmatic Programmer I figured I would let you help me get slightly better at this. Due to some ...
Doug Coats's user avatar
3 votes
1 answer
650 views

Update and sum query C# Access DB

I have a simple query using query builder of VS2012 C# which updates the database in my winforms application. The database has 216 entries so far and it's taking a lifetime to update the database. How ...
Usama Khan's user avatar
3 votes
0 answers
1k views

MS Office Suite VBA: ShellWait() and PowerShell()

I stumbled across this post on SO, and it had a link to some good code; however the code itself was a bit dated. Since the code has a "do not modify" clause I went back to the basics as noted by the ...
Gregor y's user avatar
  • 151
2 votes
3 answers
187 views

A function that replicates DLookup, and can use parameterized queries

This function was built to replace DLookup so that i could pass in parameterized queries for a speed increase. I also wanted a simple way to get more than one value if needed. For example, if i want 4 ...
KySoto's user avatar
  • 163
2 votes
2 answers
197 views

Sub that calls itself when its parent Workbook is closed

and no, I'm not talking about Workbook_BeforeClose. Note that the motivation of this question is Excel specific but the technique I'd like feedback on is not. If ...
GWD's user avatar
  • 175
2 votes
2 answers
321 views

Auto formatting and auto validating TextBox VBA

So, I created a class to avoid all the work behind the validation of input in a textbox. The idea is to pass an existing textbox and a type of the desired content and the class will take care of block ...
DT1's user avatar
  • 354
2 votes
1 answer
138 views

How to speed up a treeview population in Access?

I have the following function that causes a significant visual jittering and lag in my access database - This is a treeview selection based on data in a table (tblDATA) with the fields: Object | ...
leopardxpreload's user avatar
2 votes
1 answer
137 views

One way Synchronize 2 Access Tables with VBA ADODB

I am synchronizing two MS-Access databases. One of them on a network drive, the other one on the local machine. (For testing purposes both in the same directory) The Databases both contain a table ...
MZiegaus's user avatar
2 votes
1 answer
75 views

Convert ISO 8601 week to American-formatted date

Requirements: Implement a function that, given a standard date and an indicator whether or not the output should be in american standard (weeks start on sundays, the first week of the year is the ...
Magisch's user avatar
  • 330