ms-access-2010

How to show progress on status bar when running a sequence of queries in MS Access

烈酒焚心 提交于 2019-12-04 15:51:42
I have a macro in MS Access 2010 in Windows 7 which runs a sequence of quite slow Make Table and Update queries. I want it to show on the status bar which query it is running, as the usual message "Run query" does not give the query name. I have written the following VBA: Function RunQueryAndReportStatusWithMsgBox(QueryName As String) Dim RetVal As Variant On Error GoTo ErrHandler PutStatusBarBack MsgBox "About to run query" Application.Echo False, "Executing " & QueryName & " ..." DoCmd.OpenQuery QueryName, acViewNormal, acEdit On Error GoTo 0 Exit Function ErrHandler: Select Case Err Case

Insert into Access Select from Excel from within Access VBA

核能气质少年 提交于 2019-12-04 12:59:05
I have an Access 2010 database with all tables linked to SQL Server 2014 tables. I have an Excel 2010 (.xlsx) file (though it starts as a .csv, and I could leave it that way), that I need to import into a SQL Server table via VBA code. I know that there are import tools available to do this, however, I have 20+ XLS files per month to import, and would rather have an automated method of doing this. All my VBA code resides in the Access database, and all the examples of VBA code I've been able to find are for pushing data from Excel (i.e. the code is in Excel) not pulling from Access (i.e. the

Data macros in Access2010: triggers?

不打扰是莪最后的温柔 提交于 2019-12-04 12:54:24
I've heard on the grapevine that the forthcoming Access2010 has a Data Macros feature which will for the first time add trigger-like functionality to Access data engine tables. Does anybody have an further details on this? For example, can they created in code (ACEDAO, SQL DDL, etc)? Does the Data Macro run if the data is modified from outside of the Access user interface e.g. via ODBC, OLE DB, etc? Albert D. Kallal Ok, a bit more information. Does the Data Macro run if the data is modified from outside of the Access user interface e.g. via ODBC, OLE DB, etc? Yes it does. These true triggers

Alternative to multi-valued fields in MS Access

♀尐吖头ヾ 提交于 2019-12-04 12:29:59
问题 Related question: Multivalued Fields a Good Idea? I know that multi-valued fields are similar to many-to-many relationship. What is the best way to replace multi-valued fields in an MS Access application? I have an application that has multi-valued fields. I am not sure how exactly to do away with those and implement exactly same logic in the form of fields that are single-valued? What would be the implementation in terms of table-relationships when I want to move a multi-valued relationship

How do I create copies of CurrentDb using VBA

微笑、不失礼 提交于 2019-12-04 07:05:54
问题 I need to create copies of the CurrentDB using VBA (approx. 12 copies). The copies need to be clones of the master database containing all the same forms, queries, etc. except only a limited dataset. DoCmd.CopyDatabaseFile seems to be made for this, but only works if you are using it to copy the DB to an MS SQL Server. As MS states on their website: Copies the database connected to the current project to a Microsoft SQL Server database file for export. docmd.TransferDatabase only exports the

How to create temp tables in SQL Server via MS Access

一个人想着一个人 提交于 2019-12-04 06:49:46
问题 I have an ODBC connection to SQL Server. I need to process data within Access, but it takes too long. My idea is to push this data to a SQL Server temp table and have SQL Server do the processing. I have many pass-through queries in my Access database but do not know how I can create a temp table from Access to SQL Server. Is there a way to do this using either a query or VBA code? 回答1: Here is a snippet of VBA code I used to call a DB2 stored procedure. The same technique should work for any

MS Access: Summing time greater than 24 hours in query restarts from 1 again

百般思念 提交于 2019-12-04 06:24:21
问题 I have a table trans_hist in MS Access program where time is stored in short Date format "HH:MM" ex: [![Image][1]][1] Now I have created a query which tells total time for each user (Just simply summing the time) but if the total time exceeds 24 hours then it resets and starts over again from 00:15(all time are stored in 15 minutes intervals) Problem: For Customer(UID) 1 the total time should have been 32:30 however it shows 8:30 Current Result: UID Time_Elapsed 1 5:00 1 8:30 1 9:00 1 6:00 2

“Query is too complex” exception in MS Access 2010

走远了吗. 提交于 2019-12-04 04:05:59
问题 The following query is generating an exception. How can I simplify it? UPDATE Word SET CorrectnessCount=@CorrectnessCount WHERE GroupNo=@GroupNo AND (Name=@Adduce OR Name=@Assuage OR Name=@Athwart OR Name=@Auscultation OR Name=@Bedizen OR Name=@Behoove OR Name=@Benignant OR Name=@Betrothal OR Name=@Brazier OR Name=@Bungle OR Name=@Callow OR Name=@Caparison OR Name=@Carillon OR Name=@Caryatid OR Name=@Catechism OR Name=@Caustic OR Name=@Cavalier OR Name=@Chagrin OR Name=@Chasm OR Name=@Clamber

Exporting Recordset to Spreadsheet

旧时模样 提交于 2019-12-04 03:28:21
问题 Just getting to grips some VBA (this stuff's new to me so bear with us!) From query ContactDetails_SurveySoftOutcomes , I'm trying to first find a list of all the unique values in the DeptName field in that query, hence the rsGroup Dim storing a Grouped query on the DeptName field. I'm then going to use this grouped list as way of cycling through the same query again, but passing through each unique entry as a filter on the whole recordset and export each filtered recordset to its own Excel

Writing a routine to create sequential records

我的未来我决定 提交于 2019-12-04 02:35:44
问题 I would like to write a routine which will allow me to take dated events (records) in a table which span accross a set time frame and in the cases where no event took place for a specific day, an event will be created duplicating the most recent prior record where an event DID take place. For example: If on September 4 Field 1 = X, Field 2 = Y and Field 3 = Z and then nothing took place until September 8 where Field 1 = Y, Field 2 = Z and Field 3 = X, the routine would create records in the