access-vba

Compile error MS Access SQL

假装没事ソ 提交于 2019-12-13 07:05:37
问题 I'm getting a compile error: "Argument not optional" Basically in this code, I'm trying to do a around the table style auto-assigning. When the code is called, it starts at AssignNullProjects() and when I get the error, GetNextAssignee is highlight in the part " & GetNextAssignee & " I'm not really sure how to fix it, here's my full code below: Public Function AssignNullProjects() As Long Dim db As dao.Database Dim rs As dao.Recordset Dim strSQL As String Set db = CurrentDb strSQL = "SELECT

When creating new table and field in vba Access 2000. Getting Error Data Type Conversion Error

冷暖自知 提交于 2019-12-13 06:59:09
问题 I am trying to create a new table with a few field on vba for Access 2000. I am able to create the table and a field when the data type of the field is Text But i need it to be Number. when I am changing the data type from Text to Number it gives me the error Data Type Conversion Error. Any Help would be Appreciated. Thanks Public Sub CreateNewDB() Dim db As DAO.Database Dim tdf As DAO.TableDef Dim fld As DAO.Field 'Initialize the Contractor table Set db = CurrentDb() Set tdf = db

Saving a custom export from an Access 2007 script

拥有回忆 提交于 2019-12-13 06:54:23
问题 Hello and thanks for looking at my question. I'm attempting to get a script working to export a set of excel spreadsheets from an Access 2007 database. I have the export and other functions working quite well, it's the save function that is causing me issues. My current implementation is a message box that appears to the user asking for a folder name. This allows the user to enter an existing folder name to save to that folder, but only if that folder already exists and is in the My Documents

MS Access - Prevent prompt to save form

依然范特西╮ 提交于 2019-12-13 06:50:56
问题 Sometimes when I've made changes to the form via VBA (change in record source, control source, making controls visible or not, etc.) the user will be prompted to save the form when closing it. Is there any way to avoid this or prevent the prompt? 回答1: Im posting in the answer section because I'm unable to post under comments, I'm Relatively new to this site. Anyways, are you making the changes while other users may be using the form at the same time? That's the only thing that would make

Docmd.TransferText to update data

隐身守侯 提交于 2019-12-13 06:41:44
问题 i am using Docmd.TransferText to import data from a text file into my access table. i would like it to do the following: if the record already exists, then update it if the record does not exist then add it how do i accomplish this? currently i have this line: DoCmd.TransferText acImportDelim, yesyes, "table3", "C:\requisition_data_dump.txt", True 回答1: You cannot do this with an import. You could use transfertext to link the data as a table and then run an update and an append query. sSQL=

sequence of events in ACCESS

China☆狼群 提交于 2019-12-13 06:33:02
问题 what is the proper way of doing the following: getting DATE as user input running a query generating a report that uses the query this is the solution i was thinking: have a form that takes user input run the query open the report what is the correct way of doing this>? 回答1: I dissent from this approach, as I don't like tying reports to particular forms. Instead, I use a dialog form (as here) that is opened in the OnOpen event of the report, and writes the Recordsource of the report. If you

Show All Records For Given Field Filter In Access 2010 Table

房东的猫 提交于 2019-12-13 05:58:56
问题 Hopefully this will make sense...I have a table in Access 2010 that contains a list of suppliers and their point of contacts at the supplier and where I work. The POCs vary in number, anywhere from 1-4 up to this point. The table is set up so each POC is on a separate line. The supplier could have one contact but work could have three different contacts and vice versa. What I want to happen is when I select a value from a combobox on a form, all the related POCs need to be shown instead of

Temp Table in Access / Manage Size

一笑奈何 提交于 2019-12-13 05:51:37
问题 I have an Access file with some data. To perform certain calculations , I need to create certain tables with calculated (generated) values from the Original data. The size of these temp tables is around 500 MB each criteria , I use it. This has to be done over and over again at least 50 times for various criteria. Once the first part is completed - the temp table can be discarded. Problem is in Access even after deleting rows and dropping tables the file size still remains high. As a result

Is there a way to conditionally list field names on an access form?

不问归期 提交于 2019-12-13 05:49:32
问题 I have a large database that monitors employees attendance at training events. Each record is an employee, and there are (along with basic information) a hundred or so fields that represent training events over the last 10 years. These fields are all yes/no checkboxes and so are checked if the employee attended that workshop. I have a form that allows viewing information for individual employees easily, but I want a dynamic list on this form that shows what events the currently selected

vba Find Text box in an application using FindWindowEx

折月煮酒 提交于 2019-12-13 05:25:51
问题 I have an MS Access form that contains Button to open an application. The application is created using c# . I want to get the TextBox in the Form so that I will set a value on it using the MS Access project. I am using the following code: hwndParent = FindWindow(vbNullString, "Form1") If hwndParent <> 0 Then TextBoxHandle = FindWindowEx(hwndParent, 0&, "WindowsForms10.EDIT.app.0.3cb5890_r6_ad1", vbNullString) SendMessage TextBoxHandle, WM_SETTEXT, 0&, ByVal strText End If Above code is