ms-access

Form reference technique in Access VBA

ぐ巨炮叔叔 提交于 2020-05-17 06:15:35
问题 As per a suggestion in the comments from here, I am starting a thread to learn the reference technique for passing values and variables from form to form, also discussed here and here. As a side note, to the best of my knowledge, it's not the technique referred to here and here. Those previous questions demonstrated that the following code in the called form, sets up this technique. Dim prevForm As Form Private Sub Form_Load() Set prevForm = Screen.ActiveForm End Sub For an Access beginner

Select max of sum and max of count of a subquery

。_饼干妹妹 提交于 2020-05-16 03:14:47
问题 I have a query which gives me the sum and counts per category. It is sorted descending. The first value is the max value, so the highest sum and highest count. SELECT SUM(score) AS calcsum, category INTO newdataset FROM table1 INNER JOIN table2 ON table1.keys =table2.ID WHERE table2.filter = "Value" GROUP BY category ORDER BY SUM(score) DESC; resp. SELECT count(*) as counted, category INTO newdataset FROM table1 INNER JOIN table2 ON table1.keys =table2.ID WHERE table2.filter = "Value" GROUP

Are unique indices on Access text fields always case insensitive?

孤人 提交于 2020-05-15 02:34:47
问题 I created an MS Access table using the following code: tbl := Database.CreateTableDef('English', 0, '', ''); try fld := tbl.CreateField('ID', dbLong, 0); fld.Attributes := dbAutoIncrField + dbFixedField; tbl.Fields.Append(fld); fld := tbl.CreateField('Content', dbText, 255); fld.Required := true; fld.AllowZeroLength := false; tbl.Fields.Append(fld); Database.TableDefs.Append(tbl); idx := tbl.CreateIndex('PrimaryKey'); idx.Fields.Append(idx.CreateField('ID', EmptyParam, EmptyParam)); idx

where to put my access database in computer

主宰稳场 提交于 2020-05-12 07:21:08
问题 I've just finished my project in Visual Basic 2010. I'm using MS Access as my database. I've saved it in my documents and connected to my project. I didn't copy it to debug. Now when I create an installer and install it to another computer, an error occurs because it couldn't find my database. Manually copying my database to the other computer solves the problem. c:\users\users\documents\database.accdb The problem how could I create an installer including my database? And where should I put

where to put my access database in computer

流过昼夜 提交于 2020-05-12 07:20:50
问题 I've just finished my project in Visual Basic 2010. I'm using MS Access as my database. I've saved it in my documents and connected to my project. I didn't copy it to debug. Now when I create an installer and install it to another computer, an error occurs because it couldn't find my database. Manually copying my database to the other computer solves the problem. c:\users\users\documents\database.accdb The problem how could I create an installer including my database? And where should I put

where to put my access database in computer

你离开我真会死。 提交于 2020-05-12 07:20:07
问题 I've just finished my project in Visual Basic 2010. I'm using MS Access as my database. I've saved it in my documents and connected to my project. I didn't copy it to debug. Now when I create an installer and install it to another computer, an error occurs because it couldn't find my database. Manually copying my database to the other computer solves the problem. c:\users\users\documents\database.accdb The problem how could I create an installer including my database? And where should I put

Ucanaccess SQL Exception: feature not supported (Access and Netbeans)

China☆狼群 提交于 2020-05-09 05:26:05
问题 I've been researching this problem for days and have decided to ask this question here to see if anyone can help point me in the right direction. I'm trying to populate combo boxes in my Netbeans 8.0.2 program with data from an MS Access 2013 table. I'm using the most recent "Ucanaccess" with all of its necessary components to get the connection between the two, and from what I can tell the connection is good. However, when I run the program, it pops up an error exception message, reading:

“Object Invalid or no Longer Set” when using Variable to Reference Collection

巧了我就是萌 提交于 2020-05-08 05:50:07
问题 In the process of answering this question, I wrote a simple function to test whether an MS Access table contained all fields in a supplied array: Function ValidateFields(strTbl As String, arrReq As Variant) As Boolean Dim fld Dim fldTmp As Field On Error GoTo err For Each fld In arrReq Set fldTmp = CurrentDb.TableDefs(strTbl).Fields(fld) Next fld ValidateFields = True err: Exit Function End Function ?ValidateFields("TempTable", Array("Field1", "Field2", "Field3")) False This performs as

Bulk Insert From DataTable to Access Database

陌路散爱 提交于 2020-04-22 04:10:51
问题 Already have the DataTable populated but need to dump its entire table contents into an Access database. Using (conn) If conn.State <> ConnectionState.Open Then conn.Open() Dim adapter As OleDbDataAdapter = New OleDbDataAdapter("SELECT * FROM " & sMdbTableName, conn) adapter.InsertCommand = New OleDbCommand("INSERT INTO " & sMdbTableName & " SELECT * FROM " & sMdbTableNameSource & ";", conn) adapter.TableMappings.Add(sMdbTableName, ds.Tables.Item(sMdbTableNameSource).ToString) adapter.Update

Updating records in Access table using excel VBA

给你一囗甜甜゛ 提交于 2020-04-18 05:45:24
问题 UPDATED QUESTION: I have Update sheet, this sheet contains unique ID that matched the access database ID, I'm trying to update the fields using excel values in "Update" sheet. The ID is in the Column A the rest of the fields are stored from Column B to R. I'm trying to achieve the below, As follows: Update the record(values from Column B to R) if Column A (ID) matched existing Access database ID. Then add text in Column S "Updated" If the Column A (ID) did not found any match in the existing