ms-access

How can I show an “&” (ampersand) in button or label text?

纵然是瞬间 提交于 2020-01-01 07:43:10
问题 I would like to show the & character, not the keyboard shortcut in the text property of a button or label. Is there a way to do this? 回答1: If you are trying to display & in button text, use && . A single & is used for keyboard shortcuts, and a double ampersand will escape that. The article Escape ampersand (&) character in C# mentions that you can leave the caption unaltered with single & and just set UseMnemonic property of the button to false . 回答2: Try double & ( && ). It works with VBA

MS Access interop - Data Import

白昼怎懂夜的黑 提交于 2020-01-01 07:07:07
问题 I am working on a exe to export SQL to Access, we do not want to use DTS as we have multiple clients each exporting different views and the overhead to setup and maintain the DTS packages is too much. *Edit: This process is automated for many clients every night, so the whole process has to be kicked off and controlled within a cursor in a stored procedure. This is because the data has to be filtered per project for the export. I have tried many ways to get data out of SQL into Access and the

OpenArgs is Null error

若如初见. 提交于 2020-01-01 04:59:09
问题 I am using the OpenArgs parameter to send a value when using DoCmd.OpenForm : DoCmd.OpenForm "frmSetOther", acNormal, , , acFormAdd, acDialog, "value" I then use Me.OpenArgs inside the opened form to grab the value . It sometimes sends a Null value instead of the original string. What is wrong? 回答1: A very interesting alternative to this "openArgs" argument is to use the .properties collection of the currentProject.allforms("myFormName") object. When you need to pass a value to a form (such

MS Access: There isn't enough memory to perform this operation

倾然丶 夕夏残阳落幕 提交于 2020-01-01 04:34:13
问题 I'm using Access 2003 on a duo-core machine with 4GB of RAM, running Windows XP (Service Pack 3) [5.1.2600] Periodically, I get an error msg "There isn't enough memory to perform this operation. Close unneeded programs and try the operation again." A check of Task Manager indicates that there is plenty of free memory. Closing other open programs makes no difference. This happens sporadically, and under different circumstances: sometimes whilst saving Form design or VBA code changes, sometimes

import tab-delimited txt into Access table using VBA

拥有回忆 提交于 2020-01-01 03:24:24
问题 I am trying to import a tab-delimited txt file into an Access table using VBA. In my code, I want to insert it into a table that has not yet been created. Here is what I tried doing. Note - I was able to make this work with a CSV, and without including this: DataType:=xlDelimited, Tab:=True Sub InsertData() 'import CSV into temp table DoCmd.TransferText TransferType:=acLinkDelim, TableName:="tbl_TEMP", _ FileName:=FileNameVariable, HasFieldNames:=True, DataType:=xlDelimited, Tab:=True End Sub

Excel Data Connection Locks Access DB, Prevents Second Connection's Refresh

▼魔方 西西 提交于 2020-01-01 03:19:43
问题 I have two data connections to different queries in the same Access DB. The second one always fails (regardless of which I run first). When I look at the database, I notice that it has a lock file, which I think is causing the problem. It stays locked until I close the Excel file. Can anyone help me to unlock the db as soon as my import is complete? Additional info: I'm using Excel and Access 2010. The error: "The text file specification ' MyQuery Link Specification' does not exist. You

how to get the last record number after inserting record to database in access

天大地大妈咪最大 提交于 2020-01-01 02:36:07
问题 i have database in access with auto increase field ( ID ). i insert record like this (in C#) SQL = "insert into TermNumTbl (DeviceID,IP) values ('" + DeviceID + "','" + DeviceIP + "') "; OleDbCommand Cmd = new OleDbCommand(SQL, Conn); Cmd.ExecuteNonQuery(); Cmd.Dispose(); Conn.Close(); how to get the last inserting number ? i dont want to run new query i know that in sql there is something like SELECT @@IDENTITY but i dont know how to use it thanks in advance 回答1: More about this : Getting

Creating standalone app with Microsoft Access

微笑、不失礼 提交于 2019-12-31 16:47:49
问题 Once I saw a DB made in MS Access that worked as a normal program, i.e with an executable file that opened a beautiful UI and allowed access to the forms and reports. I've trying to do the same, I even googled but didn't find how do it. Anyone knows how to build such standalone App with Access? 回答1: You cant make an access database into an executable file. It just cant happen however you can fool people into thinking that they are not using access a number of ways, for example Custom splash

How to pass an array to a function in VBA?

*爱你&永不变心* 提交于 2019-12-31 11:36:08
问题 I am trying to write a function that accepts an array as an argument. The array can have any number of elements. Function processArr(Arr() As Variant) As String Dim N As Variant dim finalStr as string For N = LBound(Arr) To UBound(Arr) finalStr = finalStr & Arr(N) Next N processArr = finalStr End Function Here is how I try to call the function: Sub test() Dim fString as string fString = processArr(Array("foo", "bar")) End Sub I get an error saying: Compile Error: Type mismatch: array or user

Unpivot in Access SQL

偶尔善良 提交于 2019-12-31 07:38:14
问题 Hi guys I'm trying to use unpivot in SQL on MS Access and I found the following code online: SELECT CustomerID, Phone FROM ( SELECT CustomerID, Phone1, Phone2, Phone3 FROM dbo.CustomerPhones ) AS cp UNPIVOT ( Phone FOR Phones IN (Phone1, Phone2, Phone3) ) AS up; from this webpage: https://www.mssqltips.com/sqlservertip/3000/use-sql-servers-unpivot-operator-to-help-normalize-output/ However when I tried the exact same code on Access, it keeps saying the FROM clause has an error. I wonder if