access-vba

VBA Access export code module to folder

北城余情 提交于 2019-12-25 18:23:32
问题 I am trying to get Access VBA to copy one of its modules out to a folder - I have looked at the other threads / google and no joy - what do you think? Code below Sub copy_out_module() Set appAccess = New Access.Application Set dbsCurr = appAccess.CurrentProject Const ModulePath As String = "C:\Users\Sjohn\Documents\Components\" dbsCurr.Item("Module2").Export ModulePath End Sub 回答1: Your last line dbsCurr.Item("Module2").Export ModulePath can't run (Err. 438 Object can't admit property or

INSERT data FROM sql query with one constant value in MS Access with SQL

不问归期 提交于 2019-12-25 18:18:31
问题 I am trying to create a form for MS Access where you at first search for companies in a table based on criteria. The returned data is simply the names of the matching companies. I then want to take these names and add them to a different table. So far there are 3 tables: one stores the User Names (tblStartup), one Stores the Company Names (tblVC) and one shall be used to save the matches (tblContact). The problem I have is that I want to add a constant user name alongside the data from the

Unknown invalid type converson in my SQL stored Procedure

我与影子孤独终老i 提交于 2019-12-25 17:37:12
问题 Error: Conversion failed when converting the nvarchar value " value of WOID " to data type int System background: Coding in VBA using MS-Access 2010. Currently working on code behind module and calling stored procedure. The stored procedure is written in SQL and ran on the Ms-SQL server 2008 application where the database is stored. Stored Procedure: The stored procedure's purpose is to: Retrieve three input parameters: WOID, SampleID and Analyte Join two tables: tblWoSampleTest , tblTest

Creating a database in Microsoft Access that is searchable only by certain fields

房东的猫 提交于 2019-12-25 17:16:10
问题 How would you create a database in Microsoft Access that is searchable only by certain fields and controlled by only a few (necessary) text boxes and check boxes on a form so it is easy to use - no difficult queries? Example: You have several text boxes and several corresponding check boxes on a form, and when the check box next to the text box is checked, the text box is enabled and you can then search by what is entered into said text box (Actually I already know this, just playing

Return Drive name to VBA in Access from batch file

 ̄綄美尐妖づ 提交于 2019-12-25 17:01:47
问题 I have a Batch file that maps the next available free drive letter to a network drive. I use this to map a sharepoint site and then use the documents in the shared folder in my Access database. this is the batch file (which works perfectly to map the netwrok) @echo off for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do CD %%a: 1>> nul 2>&1 & if errorlevel 1 set freedrive=%%a: echo %freedrive% pause Net Use %freedrive% "http://XYZ/" pause I call this batch file as a shell from a

Filter a Report based on user input Microsoft Access

痞子三分冷 提交于 2019-12-25 16:49:54
问题 My apologies if this is an easy/straightforward solution, but I am new to Access, and I have been having some problems with my reports. I have created a report template which I want to open a single page report based on a specific IDENT NO. All of the fields in the report are then generated from the associated IDENT NO. As it currently stands, when I open the report, it will create a single page report for each ID number in the Report Data table when opened. Instead, when the user is

How to Absorb a Keypress?

假如想象 提交于 2019-12-25 16:39:29
问题 On my form I have an edit control. I have set up a KeyDown event to detect when the user pushes enter , but I also want to detect shift+space so the user can clear the contents of the box. The functionality works - I can detect the keypress. Problem is that the space does not get absorbed and so the space glyph is still typed in the control. How can I absorb the keypress when I push shift+space ? Private Sub FindBox_KeyDown(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case

VLC Playing Embedded in MS Access 2013

白昼怎懂夜的黑 提交于 2019-12-25 16:24:54
问题 I want to embed VLC video player into one of my Access forms so that users can select a video they have uploaded and play it within Access. I found code from this website: http://workingwithaccess2007.blogspot.co.uk/2013/10/vb-embedding-video-player-using-vlc.html But the code which was given doesn't work now. It could be something to do with new updates in VLC which has caused the code to not work. Dim player As VLCPlugin2 Set player = VLC.Object Dim strURL As String strURL = "C:\temp\1.mwv"

Adding parameter to existing code to export an Access Query to Excel

随声附和 提交于 2019-12-25 09:29:33
问题 'Below is the current code that I have and it will export to the excel workbook and worksheet correctly. The only problem is that I need to limit the data that gets exported by a month end date range (example: 1/31/2017 to 4/30/2017) and also by a plant number (example: "4101") thanks for any help it is greatly appreciated. Public Function InventoryXport_4100() Dim appXL As Object Dim wb As Object Dim wks As Object Dim xlf As String Dim rs As DAO.Recordset Dim fld As Field Dim intColCount As

Access - Export subform filtered results with custom file name

馋奶兔 提交于 2019-12-25 09:11:38
问题 I'm exporting filtered results from my subform to Excel, and naming Excel file as I want. Here's my code : Sub XcelExport() Dim Results As Recordset Dim RecCount As Integer Dim XcelFileName As String Dim FilePath As String Dim wb As Excel.Workbook Dim XcelFile As Excel.Application 'Set name of file with date XcelFileName = "MySubform_Results_" & Format(Date, "dd/mm/yyyy") & ".xlsx" ' Set destinaton folder of saved file FilePath = CurrentProject.Path & "\" & XcelFileName Set XcelFile = New