ms-access

The control or subform control is too large for this location on resize

删除回忆录丶 提交于 2019-12-24 18:52:39
问题 I have a simple form in Access 2003. The form has a List control and a button. I wanted to make the list to resize with the form (only vertically) while the button remains at the bottom right of the List. I'm using the following code on the form's resize event. list.Height = Me.InsideHeight - list.Top - 200 commandButton.Top = list.Height + list.Top + 50 This works fine as I resize the form, until the form height gets to a certain height. Then I get this error; Run-time error '2100': The

control what spreadsheet a query is exported to in msaccess

左心房为你撑大大i 提交于 2019-12-24 18:51:27
问题 I have a query which changes based on the criteria I set. The query's result will be changed after exporting the query to a excel spreadsheet. This is an example of how the query works CATEGORY = A,B,C FILTER = D,E,F The outcome would be something like the following: AxF After exporting it to a spreadsheet, I will run the same query again, but with a different set of parameters, such as: CxD (Instead of sending the results to different queries, I rewrite the output query's sql in vba, and

How to update-populate empty fields in A table with values from a B with a random sequence

依然范特西╮ 提交于 2019-12-24 18:46:21
问题 I am facing a huge problem! I am a police officer in a central police department in Athens Greece and i am trying to create a database that will automatically create Work Schedules for about 200 -300 police officers every day. I have created 3 tables: A) A table that contains all the information of 300 officers with their ID (as a primary key which is connected to |Table C") and other information such as address, when they were transferred to us etc . Call it "Table A" B) A table with all the

How to generate URL with parameters in MS Access vba script?

柔情痞子 提交于 2019-12-24 18:31:49
问题 I have a MS Access application that has a button on a form that should move files, update a field of the record and open a webpage with the following parameters: 1) the ID of the Access record 2) value of the updated field 3) secretword. Everything works fine except opening webpage. I've red this article:How to open a URL from MS Access with parameters and compose the line CreateObject("Shell.Application")... FSO.MoveFolder FLD_READY & "\" & rs.Fields(order_int_ID), FLD_SERVER & "\" & rs

VB.NET Access DB INSERT Not Inserting Data?

馋奶兔 提交于 2019-12-24 18:15:09
问题 I'm trying to insert a row into a table I have in Access. The table is named Site and it has two columns, SiteId (AutoNumber) and SiteName (Text). For testing purposes, I grabbed a value from an Excel sheet and attempted to insert the value into the SiteName column with the following code... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim App As New Excel.Application Dim WB As Excel.Workbook = App.Workbooks.Open("C:\MyFile.xlsx")

MS Access hitting cancel on query enter parameter box gives runtime error 2001

别等时光非礼了梦想. 提交于 2019-12-24 18:10:58
问题 I have an MS Access form with buttons that when clicked, open up tables and queries through an on-click event --> open form command. The parameter box opens, but when I press cancel a window titled "Macro Single Step" appears saying Error Number: 2001. There's a button called Stop All Macros here. How can I press cancel without getting an error? I don't use VBA at all when the button is pressed so how can I catch this error and not display it? Update: I found out that in design view if I

Error 3021 when deleting item from recordset

大兔子大兔子 提交于 2019-12-24 18:10:51
问题 When I use the code below, I sometimes receive a Error 3021. This only happens when I have one record in the recordset. Can you please tell me why, and how to fix it? It seems I've tried everything! Thanks Private Sub cmdDelSelectedAction_Click() response = MsgBox("Are you sure?", vbYesNo, "Confirmation required") If response = vbNo Then Exit Sub If Me.[Arrangement-Actions subform].Form.Recordset.EOF Then Me.[Arrangement-Actions subform].Form.Recordset.MovePrevious End If If Me.[Arrangement

Opening Word Document using VBA in Access 2013

自闭症网瘾萝莉.ら 提交于 2019-12-24 18:08:03
问题 I'm using Access 2013 and created a help button on a form that I would like to open up a Word doc with instructions. Here's the code I tried: Private Sub cmdHelp_Click() Dim wrdApp As Word.Application Dim wrdDoc As Word.Document Dim filepath As String Set wrdApp = CreateObject("Word.Application") wrdApp.Visible = True filepath = "C:\...\Handout.docx" Set wrdDoc = wrdApp.Documents.Open(filepath) End Sub The problem is, when I try to compile I get an error on the first line that says "User

Access dynamic query - Better to build one conditional SQL query or multiple queries with VBA?

跟風遠走 提交于 2019-12-24 18:07:44
问题 I have a Microsoft Access 2010 form with dropboxes and a checkbox which represent certain parameters. I need to run a query with conditions based on these parameters. It should also be a possibility for no criteria from the dropdown boxes and checkbox in order to pull all data. I have two working ways of implementing this: I build a query with IIf statements in the WHERE clause, nesting statements until I have accounted for every combination of criteria. I reference the criteria in the SQL

Looping Through Table, Changing Field Values

我们两清 提交于 2019-12-24 17:53:08
问题 I'm trying to write a piece of code that will run through a table and replace every field that has a certain value with another value. Private Sub Form_Load() Dim db As DAO.Database Dim rst As DAO.Recordset Dim strSQL As String Set db = CurrentDb() strSQL = "SELECT Profile3 FROM Bank WHERE 'AB'" Set rst = db.OpenRecordset(strSQL, dbOpenDynaset) Do Until rst.EOF With rst If .RecordCount > 0 Then .MoveFirst .Edit !Profile3 = "AA" .Update .MoveNext End If End With Loop End Sub That's what I'm