ms-access

Listbox in Ms access

末鹿安然 提交于 2019-12-25 08:58:37
问题 I can store records in the DB by using combobox with the following code. Here single part number is selected and partnumber related data is stored in the DB table. But I want the code for Listbox...When I select multiple partnumbers ..how can I store in the DB table? Case "Pn ADDED to Wrapper", _ "Pn REMOVED from Wrapper" If Me!PartNumber <> "All" And Me!PartNumber <> "Select" Then ' a proper part number has been selected in combo box strNewSq5 = _ "INSERT INTO tblTmpEventLog (TrackingNumber

Access- Open form with where clause

徘徊边缘 提交于 2019-12-25 08:49:56
问题 I need to open a specific form by a click on a subform record name. The name in the subform is showed as a combobox with ID and Name as columns. I did like this: Private Sub ID_Prodotto_DblClick(Cancel As Integer) Dim Id As Integer Id = Me.ID_Prodotto.Column.Value DoCmd.OpenForm "Prodotto", , , "ID_Prodotto = " & Id End Sub But Access requires me to manually insert the ID Field Value as I click on the record. Where am I wrong? 回答1: It should read: Id = Me!ID_Prodotto.Value or, if you wish to

sql query to select week,month, days

半城伤御伤魂 提交于 2019-12-25 08:48:25
问题 please guys, i need an sql query to select data from an access database using vb6. the query will only provide current date and the filed been compaired is curr_date in the database. for example SELECT * FROM TABLE WHERE curr_date BETWEEN firstoflastmonth AND endoflasthmonth; SELECT * FROM TABLE WHERE curr_date BETWEEN firstoflastweek AND endoflasthweek; SELECT * FROM TABLE WHERE curr_date BETWEEN firstofthismonth AND endofthismonth; SELECT * FROM TABLE WHERE curr_date BETWEEN firstofthsiweek

Updating a table in MS Access based upon Column Names

夙愿已清 提交于 2019-12-25 08:38:59
问题 I have inherited a MS Access project that is way beyond me: Table A has exam data, so each field in A is the name of an exam item and the value is the points earned on that item. My task is to convert those results to Table B, which has one field for the item name and one field for the corresponding value. So it looks like this: Table A: A.Item01 A.Item02 etc. Table B: NameofFieldinTableA Result ...so if A.Item01 = 1, I'd like that to update to Table B as: NameOfFieldinTableA = Item01 Result

SQL: query to show how many users have each property (grouped)

给你一囗甜甜゛ 提交于 2019-12-25 08:37:35
问题 I'm new to SQL and can't seem to ask the right question, as in every time I formulate it differently I end up with the same results: A query that groups data by several properties (users that share more than one property). I'm writing a JSP-based website on the Glassfish server, and manage the database from MS Access. What I'm interested in, is basically grouping by several distinct properties. Say I have a table that shows which items a user has. Something like this: id | name | item1 |

MS Access - SQL Query for Average of Each Day Data

巧了我就是萌 提交于 2019-12-25 08:33:38
问题 I have a set of data spanning across 3 days. Based on the first column from the left, is it possible to have a query that calculates the average of the values in the third column from the left based on each day? The end result will be two columns: 1/1/2008 | 1.605 2/1/2008 | 1.59 3/1/2008 | 1.56 I think the logic will be something like in a loop: Based on the day in the first column, if it is the same day, count the number of rows and add up the values of the third column Use the sum of the

Excel VBA to query MS Access database on Sharepoint with ADODB - “Not a valid file name”

余生颓废 提交于 2019-12-25 08:24:01
问题 any chance someone could enlighten me on why I'm getting an "Not a valid file name" error when trying to connect to MS Access database stored on Sharepoint? I have no issues with connecting to file on C:\ Set cnn = New ADODB.Connection MyConn = "C:\somelocation\database.accdb" With cnn .Provider = "Microsoft.ACE.OLEDB.12.0" .Open MyConn End With but when I change MyConn to Sharepoint address it doesn't work :/ MyConn = "https://some.website.com/somelocation/database.accdb" I'm getting a "Not

Select from two tables giving more rows than expected

十年热恋 提交于 2019-12-25 08:19:38
问题 I am not sure why this behaves this way. I need to select few values from two tables based on some criteria which should be clear from the query i tried below. query = @"SELECT n.borrower, a.sum, n.lender FROM Notification AS n, Acknowledgment AS a WHERE n.deleted=@del2 AND n.id IN (SELECT parent_id FROM Acknowledgment WHERE status=@status AND deleted=@del1)"; This returns more rows (12) than expected. I have two tables Notification and Acknowledgment both which have field "sum". When I try

Access SQL using IN where record must satisfy all values

我的未来我决定 提交于 2019-12-25 08:16:44
问题 I have a join statement, like this: SELECT distinct(p.id), p.id, p.first_name as [First Name], p.last_name as [Last Name] FROM tbl_person as p , tbl_person_languages as pl WHERE pl.person_id = p.id AND pl.language_id in (12,14,...) but this returns all records. I would like to pull back the distinct record of an individual that has all values of pl.language_id, not just one or more values. I should note, the values in the IN statement may have 1 or more values Any ideas on how to do this? I

Error in list of function arguments: '=' not recognized. unable to parse query text. - C# Table Adapter

六月ゝ 毕业季﹏ 提交于 2019-12-25 08:15:18
问题 This is a follow-up of a previous requestion. Here Is the link It Was about selecting Value from the same field twice with different conditions and display results in separate fields And Used Following Code In table Adapter - IIF SELECT AttendanceReg.StudentID,AttendanceReg.Studname, AttendanceReg.StudSex, AttendanceReg.StudCourse, SUM(IIf( AttendanceReg.AttendStatus = 'Present', 1,0)) AS TotalPresent, SUM(IIf( AttendanceReg.AttendStatus = 'Absent', 1,0)) AS TotalAbsent, DatePart('m',