7 votes
Accepted

Add Default Rubberduck VBA Folder Annotation to VBProject.VBComponents

HasFolder = InStr(.Lines(1, .CountOfLines), Chr(39) & "@Folder") That condition can technically be True in ...
Mathieu Guindon's user avatar
6 votes

General function to test for empty/no-value controls

Case Is = "CheckBox" That syntax is very weird and unusual, surprising even. This would be more common, and simpler: ...
Mathieu Guindon's user avatar
6 votes
Accepted

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

...
Mathieu Guindon's user avatar
6 votes

Excel VBA used to fetch Access data

There's nothing to optimise here. Your steps are: Open connection Execute about the simplest SQL query possible End There's nothing we can change there ...
Kaz's user avatar
  • 8,790
5 votes

A function that implements a query

Namespace scope and pollution is often a problem in programming, and when reading code, if there are two usages of a particular identifier, a reader may not understand exactly which one you mean, and ...
rbp's user avatar
  • 153
5 votes

Retrieving database values through properties

Properties in Standard Modules Standard modules can have Properties, but as @Rubberduck pointed out, they're not necessarily intuitive (although they do force you to qualify a call with the module ...
ThunderFrame's user avatar
  • 1,959
5 votes

Automated document downloading, with error handling

Some basics Trivial and not really going to affect your current code, but consider setting DownloadStatuses as flaggable errors (instead of ...
AJD's user avatar
  • 2,346
5 votes

Python SQL insert to MSAccess with VBScript

I'm stuck in the same situation (managing a database with MS Access frontend), so I can't comment on the technologies used here. However, for the VB Script itself, I highly recommend parameterizing ...
ApexPolenta's user avatar
4 votes

Automatically generate a thunderbird importable contacts file for all employees

Variables I like that you're using Option Explicit. It helps prevents "easy" mistakes from typos. I don't like that you declare all your variables in a block and I ...
Vogel612's user avatar
  • 25.2k
4 votes
Accepted

Creating dialog with Access form instances

Using `Val` The Val function can run into problems when converting string values, depending upon the locale of the user. It is generally safer to use ...
ThunderFrame's user avatar
  • 1,959
4 votes

A function that replicates DLookup, and can use parameterized queries

I'm going to cover other points that aren't covered... Unnecessary recordset movement You have this: ...
this's user avatar
  • 2,019
3 votes
Accepted

C# Datagridview to Access database

Con Use full names. If it's a connection string then name it ConnectionString especially if it's out of scope and one cannot ...
t3chb0t's user avatar
  • 44.2k
3 votes

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

The first thing I thought when I read your question is that the Period column should either be a computed column or not a column at all (with it being generated as necessary in stored procedures or ...
Rich's user avatar
  • 31
3 votes

A function that replicates DLookup, and can use parameterized queries

Declaring qry As QueryDef is unnecessarily limiting your function to Queries. With a few changes the function could be ran against Queries or Tables. ...
TinMan's user avatar
  • 4,133
3 votes

A function that replicates DLookup, and can use parameterized queries

I almost never use DAO, so I'll focus on the following... Style The block comment should really go above the Function declaration by convention. Placing it ...
Comintern's user avatar
  • 4,192
3 votes
Accepted

How to speed up a treeview population in Access?

Avoid the multiple DLookUps with eachTreeView.Nodes.Add call for every row of recordset! At the very least store your ...
Parfait's user avatar
  • 960
3 votes
Accepted

Sub that calls itself when its parent Workbook is closed

Unfortunately, the Release magic trick is dangerous because it can mess with the underlying EbMode function used by VB to ...
Cristian Buse's user avatar
2 votes

DAO recordset effiency

I wonder about the table design. It seems the CustomerID is a string whereas generally it is best to use long integers. Also has the CustomerID field in the table been indexed or set to primary key? ...
Skippy's user avatar
  • 21
2 votes

Overriding all Access form control AfterUpdate methods

Your class has a memory leak: both the form object and the associated event handler object will never get cleared by the garbage collector (well, I'm not 100% sure on where the reference to ...
Erik A's user avatar
  • 171
2 votes

A function that implements a query

As rbp says, while the shared name between function name and query name might be intuitive in your mind, and might work under DAO/Access, it might not be intuitive to users that inherit your code, and ...
ThunderFrame's user avatar
  • 1,959
2 votes

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

Variables You have a bunch of variables that are declared but never used: fso, filelocation1, ...
Comintern's user avatar
  • 4,192
2 votes
Accepted

MS Access SQL query for active assigned cases

I can't see any major flaw in this query. I would just make the Jointures like this, as it's more clear : ...
Thomas G's user avatar
  • 136
2 votes

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

In VB.NET 14 (for VS2015) you can use String interpolation and make your code a lot cleaner (For Reference) you could write the loop, that Mat's Mug talks about, like this: ...
Malachi's user avatar
  • 28.6k
2 votes
Accepted

Convert ISO 8601 week to American-formatted date

convertDateToFormattedCalendarWeek = "error" Debug.Print ("function convertDateToFormattedCalendarWeek called with invalid parameter mode " & mode) Bad idea. ...
Mathieu Guindon's user avatar
2 votes

Excel VBA used to fetch Access data

Nothing wrong with the code, I suppose you could record a macro in Excel to confirm but the answer, with regard to the time taken to retrieve data from the Access database can be down to the ...
JonTout's user avatar
  • 121
2 votes
Accepted

Resizing the controls on an Access form dynamically

So, I fiddled enough with the code that I think I found a solution that solves almost all the problems mentioned in the question. UPDATE I had the percentages of the heights for the header and ...
BarrettNashville's user avatar
2 votes

C# Datagridview to Access database

Here are some minor suggestions in addition to t3chb0t's: Using var OleDbCommand cmd = new OleDbCommand() could easily be ...
Shelby115's user avatar
  • 1,961
2 votes

General function to test for empty/no-value controls

no chance of introducing a bug at this point - Oh ye of little faith :) there will always be bugs. Always. But seriously, this is very good for the most part. I only have a few suggestions. Since ...
Joseph's user avatar
  • 221
2 votes
Accepted

Generic database select method for within my application

First things first: your current code has a huge optimization to be made. foreach (var p in parameters) { args.Add(argNames[parameters.IndexOf(p)], p); } ...
Der Kommissar's user avatar
2 votes
Accepted

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

The first thing I would suggest is to avoid as much as possible depending on the DoCmd object. The DoCmd object is essentially ...
this's user avatar
  • 2,019

Only top scored, non community-wiki answers of a minimum length are eligible