access-vba

ADODB recordset column headers

人盡茶涼 提交于 2019-12-24 08:18:35
问题 I'm copying ADODB.Recordset data to excel file, but it copies the recordset data to excel without column headers.I'm using MS Access 2013, CompyFromRecordset command. my question is, is there any way to copy the data headers of RecordSet? For i = 0 To iFieldCount - 1 objSheet.Range("A" & i + 1).CopyFromRecordset rst objBook.Save Next i 回答1: A "header" is not a record and the CopyFromRecordset command does not include the headers. You must put the header in your sheet yourself by iterating

ADODB recordset column headers

烈酒焚心 提交于 2019-12-24 08:17:02
问题 I'm copying ADODB.Recordset data to excel file, but it copies the recordset data to excel without column headers.I'm using MS Access 2013, CompyFromRecordset command. my question is, is there any way to copy the data headers of RecordSet? For i = 0 To iFieldCount - 1 objSheet.Range("A" & i + 1).CopyFromRecordset rst objBook.Save Next i 回答1: A "header" is not a record and the CopyFromRecordset command does not include the headers. You must put the header in your sheet yourself by iterating

VBA to generate permanent Controlls in Microsoft Access

百般思念 提交于 2019-12-24 08:16:58
问题 Situation: I download Attachments from Outlook and import them into Access tables based on a few criteria. For example, I download following files: SenderA_A_Timestamp.csv, SenderA_B_Timestamp.csv, SenderB_C_Timestamp.csv, SenderC_A_Timestamp.csv and loads more. Now I have made a form where the user can, for example, select all type C CSV-Files since a date or just all types, since a certain date. Cluster, Hosts and Volume represent the File types. The datetime indicates when it was updated

Access Not allowing INSERT or UPDATE of null values in SQL-Server column (Access Run-time Error 3162)

橙三吉。 提交于 2019-12-24 07:49:20
问题 Hello the wide world of stackoverflow, ISSUE: I am currently working on developing a sql-server database that uses access forms to get and insert data. Prior to yesterday everything was working fine. The issue now is that I am getting the following error when trying to run my insert query. Access Runtime Error '3162': You tried to assign the Null value to a variable that is not a Variant data type. ISSUE DETAILS: This seems to be a result of Access not letting me INSERT or UPDATE null values

Dynamic Access Form

橙三吉。 提交于 2019-12-24 07:35:17
问题 I am creating a dynamic form in Access 2003. Each time the form is opened combo boxes are created based on table of "keywords." My code is having trouble deleting old boxes (or their labels, I'm not sure) and every opening after the first gets hung up on duplicate names (Run-time error '2450'). Secondly, junction table holding the "checked" keywords will fills up at a low finite amount. Thirdly, I can't figure out how to populate the combo boxes based on the junction table records. When the

VBA Access: How to link an updatable recordset to an updatable FORM and save the changes in SQL Server

拥有回忆 提交于 2019-12-24 07:33:16
问题 I retrieve data from a SQL Server through ADO and store it in a ADODB Recordset. Then, I link a FORM to this recordset. And then I use some controls (labels, textboxes, Data field) to show the information from the recordset, in an automatic way (control data source is set to the FORM/Recordset table name). And it shows the info correctly. The problem comes because it DOES NOT update the changes (for example in the DATA control) into the recordset and/or in the SQL Server. The recordset has a

msGraph API from msAccess VBA - Planner plans credentials issue

三世轮回 提交于 2019-12-24 06:25:28
问题 I am very new to MS Graph and Office 365 and have made good progress. I am an O365 Global Admin for my organisation (a school) and have app development experience. There is a lot of scope for using MS-Access databases in our context for "globally" managing the O365 content. eg contacts, distribution lists and planner tasks. We want to manage these from an on-premises ms-access database or two and with an admin person authenticating the ms-graph activity, ideally. So, to test, I created a new

Access VBA If statement to Change Back and Font color of a report field

馋奶兔 提交于 2019-12-24 04:53:17
问题 I'm trying to make a field on a report highlight in red with white bold font on a report when it has an "S" populated. This keeps making all records in the field red. Please help! Private Sub Report_Activate() If Me![PULL STATUS] = "S" Then Me![PULL STATUS].BackColor = vbRed Me![PULL STATUS].FontBold = True Me![PULL STATUS].ForeColor = vbWhite End If End Sub 回答1: The code you have should be contained in the On Format event of the Detail section of the report. When you set the BackColor ,

Reproduce MSACCESS.EXE process still running after application exit

こ雲淡風輕ζ 提交于 2019-12-24 04:21:56
问题 Access will sometimes fail to exit cleanly and leave an MSACCESS.EXE process running with no visible user interface (the application is no longer shown in the Applications tab of Task Manager). What is the minimal code necessary to reproduce this error? UPDATE : I've posted an answer that reliably reproduces the problem. I would be very interested in other scenarios that may also reproduce the issue. I will upvote any future answer that successfully reproduces the problem. I would like to

Reproduce MSACCESS.EXE process still running after application exit

試著忘記壹切 提交于 2019-12-24 04:21:06
问题 Access will sometimes fail to exit cleanly and leave an MSACCESS.EXE process running with no visible user interface (the application is no longer shown in the Applications tab of Task Manager). What is the minimal code necessary to reproduce this error? UPDATE : I've posted an answer that reliably reproduces the problem. I would be very interested in other scenarios that may also reproduce the issue. I will upvote any future answer that successfully reproduces the problem. I would like to