Skip to main content
4 votes
Accepted

How to compact the current MS Access database from VBA function

This is simply not possible. Compacting and repairing a database requires the database to be closed. As such, you can't compact and repair a database between steps in a sub or procedure, since the ...
Erik A's user avatar
  • 248
3 votes

How to minimize full ms-access window in vba?

Almost, but not quite. The one you're looking for is DoCmd.RunCommand acCmdAppMinimize (minimize the Access window) Also: DoCmd.RunCommand acCmdAppMaximize DoCmd.RunCommand acCmdAppRestore
Nelson's user avatar
  • 1,689
3 votes

PostgreSQL: alternative ways to connect to database

A poor man's solution might be simply installing pgAdminIII, setting up the connection to the database and using it's built in filtering and data view/modification functionality. I admit this does ...
András Váczi's user avatar
3 votes

VBA Maximize Access Application Main Window

Me propose this new solution, work perfectly in my application: Dim StrDbAccessPath As String, appAccess As New Access.Application StrDbAccessPath = "C:\access.mdb" '--> path of access appAccess....
Agustí Panadès's user avatar
2 votes
Accepted

Access: Number format for VBA in queries of variant type

The answer can be found here in Allen Browne's page: in a query, a column can be only be ONE data type. JET therefore treats Variants as Text, since anything (numbers, dates, characters, ...) is ...
C Perkins's user avatar
  • 477
2 votes
Accepted

Visual Studio extract database values to excel with header text!

When you paste code as an image, it's difficult the take that code and rewrite it to show you the correct way to do it. You should always paste your code as text when asking a question. You need to ...
Scott Hodgin - Retired's user avatar
1 vote
Accepted

SQL how to remove duplicate results from same table

Following code should work, tested in Memory table: DECLARE @TBL AS TABLE ( ID INT IDENTITY(1, 1) PRIMARY KEY CLUSTERED, First VARCHAR(10), Last VARCHAR(10), Address VARCHAR(30), ...
Angel M.'s user avatar
  • 204
1 vote

SQL Server: Trigger with UPDATE statement causes deadlocks

Your trigger has a fatal flaw: it only deals with a single insert. You need to rewrite it to join by the PK of inserted and deleted. To avoid the deadlock, add both UPDLOCK and HOLDLOCK hints to the ...
Charlieface's user avatar
1 vote

How to send an access database

I'm presuming that your Access app do not have split database (front-end/back-end). Your Access app users have to download the App to their desktop and launch the App from their desktop. If for any ...
cbk's user avatar
  • 11
1 vote
Accepted

MS-Access Beginner Replace Textbox Caption With Combo Box Selection on Button Press

There are multiple problems with this approach. A caption is a constant, it can't be assigned an expression. Make a textbox that looks like the object you want. You don't need an OnClick event. ...
HackSlash's user avatar
  • 161
1 vote
Accepted

How to save Outlook attachment in a drive with a new name and overwrite if it already exists?

Public Sub saveAttachtoDisk(itm As Outlook.MailItem) Dim obj As Outlook.Attachment Dim saveFolder As String saveFolder = "D:\EmailAttachments" For Each obj In itm.Attachments ...
madProgrammer's user avatar
1 vote
Accepted

How to refer to Field Name with a ? in it in MS Access VBA code

You can't have special characters in a VBA name. The bang operator ( the ! in Me![ActorRetired?] = -1) is just a shortcut for string based name lookup. It's not syntactically clear so I recommend ...
HackSlash's user avatar
  • 161
1 vote
Accepted

Cannot login to a MS Access database

Instead of looking for matching username and password from the table, I would suggest you to use login system explained in this link. You just need to import forms and code from demo database from the ...
Pacman's user avatar
  • 38
1 vote

How to compact the current MS Access database from VBA function

This repairs and compacts the open/current database from a command button or from a custom ribbon: Function CompactIt() Dim WshShell As Object Set WshShell = CreateObject("WScript....
Timmy the Mouse's user avatar
1 vote
Accepted

Inserting ID and Date to locate data for C#/VBA application

-Please don't use short, cryptic column names. -There's no reason to wrap individual statements in explicit transactions. You'll want to extract the key value from the table variable in a separate ...
David Browne - Microsoft's user avatar
1 vote

Transfer datas from Access to PostgreSQL

If you have established the connection between your Access database and PostgreSQL via ODBC, you can just create a VBA module (I called mine test_remote_insert). I've got two tables: On PostgreSQL ...
joanolo's user avatar
  • 13.4k
1 vote

Transfer datas from Access to PostgreSQL

Install the PosgresQL ODBC driver and then use that to register Postgres tables in Access. Issuing the SQL you have given in Access will then transfer data from Access to PosgresQL.
Grimaldi's user avatar
  • 420
1 vote

vba Excel data Validation error 'Application-defined or object-defined error'

I found a way around the issues i had, related to Excel Data Validation setup from Access via VBA. Here: https://msdn.microsoft.com/en-us/library/office/ff840715.aspx For some weird reason, VBA ...
Choper's user avatar
  • 11
1 vote

Access 2010-2016 Compatibility Error

First: - Check for "Missing:Reference" in the Visual Basic Editor. Typically it's MS Access inheriting the new references and not reverting them or making them backwards compatible. Second: - Could ...
Chris Koch's user avatar

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