ms-access

Delete selected row from DataGridView and MS-Access Database

人盡茶涼 提交于 2021-02-10 15:04:55
问题 I am trying to delete the selected row from DataGridView and MS-Access database.. Private Sub ButtonEditDelete_Click(sender As Object, e As EventArgs) Handles ButtonEditDelete.Click If Not Connection.State = ConnectionState.Open Then Connection.Close() End If Try If Me.DataGridViewEdit.Rows.Count > 0 Then If Me.DataGridViewEdit.SelectedRows.Count > 0 Then Dim intStdID As Integer = Me.DataGridViewEdit.SelectedRows(0).Cells("Username").Value Connection.ConnectionString = "Provider=Microsoft.ACE

Calculate difference between two time records

馋奶兔 提交于 2021-02-10 14:41:04
问题 I found many questions similar to mine but not quite the same, and nothing I found in them helped me so here is new one. Expected output: Difference between one time record and previous one if the User is the same. Sample table: +-------+--------+-------------------+------+ | RowID | User | Godzina_transakcji| Diff | +-------+--------+-------------------+------+ | 1 | AAA | 14:23:03 | | | 2 | AAA | 14:23:57 | | | 3 | AAA | 14:25:03 | | | 4 | BBB | 03:37:23 | | | 5 | BBB | 03:39:21 | | | 6 |

Disable warning about a program trying to send an email

时间秒杀一切 提交于 2021-02-10 14:41:03
问题 I send an email using Outlook 2010 with Access VBA. I get a warning from Microsoft Outlook about a program trying to send an email and I'm forced to push allow. I have the Microsoft Outlook Object Library 14 from the reference in VBA. In Outlook - Options - access through programin is marked on don't show warnings. I added the next entries in regedit Key: HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\ <version>\Outlook\Security Value name: AdminSecurityMode Value type: REG_DWORD Value:

Calculate difference between two time records

时光怂恿深爱的人放手 提交于 2021-02-10 14:40:42
问题 I found many questions similar to mine but not quite the same, and nothing I found in them helped me so here is new one. Expected output: Difference between one time record and previous one if the User is the same. Sample table: +-------+--------+-------------------+------+ | RowID | User | Godzina_transakcji| Diff | +-------+--------+-------------------+------+ | 1 | AAA | 14:23:03 | | | 2 | AAA | 14:23:57 | | | 3 | AAA | 14:25:03 | | | 4 | BBB | 03:37:23 | | | 5 | BBB | 03:39:21 | | | 6 |

Disable warning about a program trying to send an email

感情迁移 提交于 2021-02-10 14:40:09
问题 I send an email using Outlook 2010 with Access VBA. I get a warning from Microsoft Outlook about a program trying to send an email and I'm forced to push allow. I have the Microsoft Outlook Object Library 14 from the reference in VBA. In Outlook - Options - access through programin is marked on don't show warnings. I added the next entries in regedit Key: HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\ <version>\Outlook\Security Value name: AdminSecurityMode Value type: REG_DWORD Value:

Changing Textbox.DefaultValue in Access

萝らか妹 提交于 2021-02-10 09:21:40
问题 I would like to be able to change the Textbox.DefaultValue during the 'On Load' event of a form such that each time the form is loaded the user is prompted with an InputBox to change a specific TextBox.Default value which in my case the TextBox control on the table is called Stream. I have tried the following code but each time it gives me a 'RunTime Error 3422 Cannot modify table structure. Another user has the table open'. Private Sub Form_Load() CurrentDb.TableDefs("Class 1 Students (C1)")

Access VBA - Open Form to Specific Record from Report

感情迁移 提交于 2021-02-10 07:47:04
问题 I have a report that lists Deposits, with the DepositID set as a hyperlink. OnClick of DepositID, it opens the Deposit Entry form to that particular record. However, the form opens to a new record instead of the one the user clicks on. I think it is because I have another bit of code that runs OnLoad of the form that goes to a new record, and it might be executing that after executing the OnClick code. OnClick of DepositID from the report: DoCmd.OpenForm "DepositForm", acNormal, "", "

Access Run time error - '-2147352567 (80020009)': subform

雨燕双飞 提交于 2021-02-10 07:01:22
问题 I've created a form where I can use a subform to load data from a query into textboxes so I can edit the data one at a time and update the database. This usually works fine except I have a run time error that randomly appears now and then - '-2147352567 (80020009)': The value you entered isn't valid for this field.' If I stop running it and try running it again it usually works fine until the same run-time error appears. It's very inconsistent. Private Sub btn_SelectAgency_Click() If Not (Me

Calling function in one MDB from another MDB

末鹿安然 提交于 2021-02-08 14:19:06
问题 We have developed a consolidation function that will be used by other processes and want to position the function in its own MDB (call it "remote") so that it can be referenced and called from "caller.mdb" when its needed. The function is designed to return an array and works great when executed called directly from within "remote." However, with "remote" properly referenced in the "caller" VBA project, when "caller" makes the call the function returns errors. We get a variety of errors such

Access filter won't show value list to choose from after 1st filter is set

故事扮演 提交于 2021-02-08 11:54:47
问题 I'm having a little trouble with the form filter in Access 2007. I'm using the listview in a few forms and the user needs to be able to filter there. For testing purposes I made a query, which is just based on one table. If I want to set the first filter, it looks like that: I choose a value and if I want to set another filter (on a different field obviously), there aren't values available to choose from. This seems to happen only if I use a query (doesn't matter if I use every field, or just