access-vba

Runtime error 3144

夙愿已清 提交于 2019-12-13 09:12:03
问题 I am using this code and once I run it I get runtime error 3144 . I don't know where in the code needs to be changed or is not correct. Can you please help me to fix it? CurrentDb.Execute "UPDATE WORKED_HOURS " & _ " set EMPLOYEE_ID=" & `enter code here`Me.cboEmployeeID & _ ", SET FIRST_NAME='" & Me.FIRST_NAME & "'" & _ ", SET LAST_NAME='" & Me.LAST_NAME & "'" & _ ", Set WORK_ORDER_NO='" & Me.cboWorkOrderNo & "'" & _ ", SET PROJECT_TITLE='" & Me.txtProjectTitle & "'" & _ ", SET WORKED_DATE='"

Transform and Pivot in Ms-Access

荒凉一梦 提交于 2019-12-13 08:29:26
问题 I have a table looks like: Field1 Field2 Blank Fail Pass Date a 1 0 20 40 170101 a 2 1 19 99 170101 b 1 0 54 24 170101 c 3 1 24 30 170101 a 1 0 11 19 170102 b 2 0 21 266 170102 a 1 2 10 40 170103 .... The user then chooses the date range they want to display and I want my result to look like: Field1 Field2 0101_B 0101_F 0101_P 0102_B 0102_F 0102_P 0103_B 0103_F 0103_P a 1 0 20 40 0 11 19 2 10 40 a 2 1 19 99 b 1 0 54 24 c 3 1 24 30 b 2 0 21 266 Any help really appreciated! 回答1: Options: a

System.Object and System.EventArgs

拥有回忆 提交于 2019-12-13 08:26:15
问题 I'm trying to write a simple calendar for selecting dates. I have an array of PushButtons, and now I'm trying to programmatically add event handlers. Public Sub Initialize() If EventID = 0 Then GetEmployeeData EventType = "Attendance" Else GetEventData End If Dim Days Days = Array(Sunday0, Monday0, Tuesday0, Wednesday0, Thursday0, Friday0, Saturday0, _ Sunday1, Monday1, Tuesday1, Wednesday1, Thursday1, Friday1, Saturday1, _ Sunday2, Monday2, Tuesday2, Wednesday2, Thursday2, Friday2, Saturday2

Access SQL Update record

末鹿安然 提交于 2019-12-13 08:25:49
问题 I need to update an existing record in a table. I have been trying two different methods but can't see what I am missing: First attempt was: CurrentDb.Execute "UPDATE [MS Access;pwd=" & strPassword & ";database=" & DBpath & "\" & DBname & "].[" & tblengagement & "] SET [Close_Time] = #" & Time & "#, WHERE ID = '" & SessionID & "'" Second attempt: CurrentDb.Execute " UPDATE [MS Access;pwd=" & strPassword & ";database=" & DBpath & "\" & DBname & "].[" & tblengagement & "] " _ & "(Close_Time)

Access SQL that will display multiple maximum/minimum values and their corresponding case

风格不统一 提交于 2019-12-13 07:51:06
问题 I am trying to create an SQL query in Microsoft Access that will produce the maximum/minimum values for each of the fields below and return with their corresponding case attached **Force Table** case Flxmax Flxmin Frxmax Frxmin hs00p16010od 582.24 666.81 796.44 -451.15 hs00p16015od 878.7 878.7 1096.3 -500.36 hs00p16020od 1071.95 1071.9 1281.2 -743.05 hs00p16025od 1186.65 1186.6 1397.8 -959.36 Desired Output Flxmax 1186.65 hs00p16025od Flxmin 666.81 hs00p16010od Frxmax 1397.8 hs00p16025od

Ms Access Data Macro Return Record Set

北慕城南 提交于 2019-12-13 07:37:01
问题 I am using a Data Macro for one of my Access table's after insert event. Inside this Data Macro, I am using SetLocalVar to call one of my functions written in vba to insert the same inserted record set into my SQL Database. This is how the Expression in SetLocalVar currently looks like; AfterInsertMacro("TblLotStatus",[LotStatusID], [NextStatus], [Status], [Printed], [Active], [AvailableForPull] ) Now, instead of returning back every column as a separate variable, can't I return a record set

Access Buttons VBA Problems and Subform Issues

喜你入骨 提交于 2019-12-13 07:33:23
问题 Im working on a key inventory database. Something to manage who signs out room keys and when they bring them back in. I've created the tables I plan on using and have started working on the forms. However, I am having trouble getting the forms/subforms to work as desired. I've created buttons to add/edit/delete/etc the records in the subform which are a result of the tables. I've coded the buttons based on an old project I did in my DB class (someone else did the forms then, I did queries). I

error 3075 when running SQL in access 2007 vba

喜你入骨 提交于 2019-12-13 07:32:00
问题 I wonder why I can't execute this SQL query in access 2007 through VBA, which can be executed when i create a query myself: Private Sub SQL_Click() Dim curDatabase As Database Dim RS_REPORT As Recordset Set curDatabase = CurrentDb Set RS_REPORT = _ curDatabase.OpenRecordset("REPORT_CONTENT_ARCHIVE", dbOpenDynaset) strStatement = "SELECT REPORT_CATEGORY1.DESCRIPTION, REPORT_CATEGORY2.DESCRIPTION, REPORT_CATEGORY3.DESCRIPTION, REPORT_RECOMMENDATION.RECOMMENDATION, REPORT_CONTENT_ARCHIVE.REPORT

Saving Image as OLE Object, in Access

天大地大妈咪最大 提交于 2019-12-13 07:21:23
问题 I have a table with a field that is of type OLE Object. I then have a form with a number of fields. Some are just text fields. But, I also have an Image object on the form. When a user clicks a button, a dialog opens and they can pic a photo. Once they select the photo, the Image object displays that picture. I want to save that image to database. What I have only seems to save a reference to where the file is located, on the computer. So, this would not work if the db is moved. Here is the

Add user input to Excel table upon upload to Access database

走远了吗. 提交于 2019-12-13 07:17:35
问题 I'm trying to combine user inputs with existing Excel file data so they will all be included in a single table when they are uploaded to the Access database. Here is the way I have it laid out, but I'm open to changing it however need be. I'm just completely stuck with what to do next. Upload Date is automatically filled in, but the rest of the parameters will vary based on the product and will have to be filled in manually. I also want it to be mandatory that every field is filled in, so