ms-access

Looking for a better way to set properties for form controls

拟墨画扇 提交于 2020-12-15 03:43:56
问题 I'm using the code below in many forms and several applications: Private Sub EnableEdit(strFieldname As String, Optional bUseRed As Boolean = False) Me.Controls(strFieldname).Enabled = True Me.Controls(strFieldname).Locked = False If Not Me.Controls(strFieldname).ControlType = acCheckBox Then Me.Controls(strFieldname).BackStyle = 1 If bUseRed Then Me.Controls(strFieldname).ForeColor = vbRed Else Me.Controls(strFieldname).ForeColor = vbBlack End If End If End Sub ' and the calls e.g.

Looking for a better way to set properties for form controls

自作多情 提交于 2020-12-15 03:43:55
问题 I'm using the code below in many forms and several applications: Private Sub EnableEdit(strFieldname As String, Optional bUseRed As Boolean = False) Me.Controls(strFieldname).Enabled = True Me.Controls(strFieldname).Locked = False If Not Me.Controls(strFieldname).ControlType = acCheckBox Then Me.Controls(strFieldname).BackStyle = 1 If bUseRed Then Me.Controls(strFieldname).ForeColor = vbRed Else Me.Controls(strFieldname).ForeColor = vbBlack End If End If End Sub ' and the calls e.g.

How to use MS Access ODBC driver without installing it?

我是研究僧i 提交于 2020-12-14 12:37:39
问题 Up until today our company workstations would typically have the MS Office ODBC drivers installed in: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE14 However, for some reason the configuration recently changed so that for example Microsoft Access Driver (*.mdb, *.accdb) now points to: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE16 Unfortunately the actual installation of the driver is still in the OFFICE14 directory. Is there any way to still use this driver to

How to use MS Access ODBC driver without installing it?

£可爱£侵袭症+ 提交于 2020-12-14 12:30:40
问题 Up until today our company workstations would typically have the MS Office ODBC drivers installed in: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE14 However, for some reason the configuration recently changed so that for example Microsoft Access Driver (*.mdb, *.accdb) now points to: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE16 Unfortunately the actual installation of the driver is still in the OFFICE14 directory. Is there any way to still use this driver to

How to use MS Access ODBC driver without installing it?

老子叫甜甜 提交于 2020-12-14 12:29:11
问题 Up until today our company workstations would typically have the MS Office ODBC drivers installed in: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE14 However, for some reason the configuration recently changed so that for example Microsoft Access Driver (*.mdb, *.accdb) now points to: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE16 Unfortunately the actual installation of the driver is still in the OFFICE14 directory. Is there any way to still use this driver to

Currentdb.Execute with dbFailonError not throwing an error

久未见 提交于 2020-12-13 17:56:39
问题 In Access 2003-2016, I am using CurrentDb.Execute with dbFailonError to run an INSERT statement. The INSERT statement should fail (and it does) because one field has an incorrect value based on a related table with "Enforced Referential Integrity". However, it does not throw an error. I have tried recreating this issue in a new database, and the error works correctly. There is something wrong in the settings with my current database, and I don't want to recreate it from scratch. I have taken

VBA - Set Default Save As Name Without Opening Dialog

故事扮演 提交于 2020-12-13 17:55:25
问题 I have created a Word document using VBA in Access by creating a new Word.Application, importing a document with Documents.Add and then making the desired changes. Once the changes are made the document is activated and Word is given focus. I'm trying to change the suggested name that appears when a user first tries to click "Save As" in this document, but without opening the dialog immediately. I have set a title using .ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle) = "Title" once

VBA - Set Default Save As Name Without Opening Dialog

℡╲_俬逩灬. 提交于 2020-12-13 17:54:05
问题 I have created a Word document using VBA in Access by creating a new Word.Application, importing a document with Documents.Add and then making the desired changes. Once the changes are made the document is activated and Word is given focus. I'm trying to change the suggested name that appears when a user first tries to click "Save As" in this document, but without opening the dialog immediately. I have set a title using .ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle) = "Title" once

Currentdb.Execute with dbFailonError not throwing an error

痴心易碎 提交于 2020-12-13 17:49:32
问题 In Access 2003-2016, I am using CurrentDb.Execute with dbFailonError to run an INSERT statement. The INSERT statement should fail (and it does) because one field has an incorrect value based on a related table with "Enforced Referential Integrity". However, it does not throw an error. I have tried recreating this issue in a new database, and the error works correctly. There is something wrong in the settings with my current database, and I don't want to recreate it from scratch. I have taken

VBA - Set Default Save As Name Without Opening Dialog

空扰寡人 提交于 2020-12-13 17:49:28
问题 I have created a Word document using VBA in Access by creating a new Word.Application, importing a document with Documents.Add and then making the desired changes. Once the changes are made the document is activated and Word is given focus. I'm trying to change the suggested name that appears when a user first tries to click "Save As" in this document, but without opening the dialog immediately. I have set a title using .ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle) = "Title" once