Hi, I've tried everything to get this to work with access. I can get it to work with SQL but unfortunately in this case I can't use SQL. Problem is that when I try and update the record, I get an error saying that the update method is not supported or that the lock is incorrect. It's a 3251 error.
Here's the code I'm using:
Dim dbConn2 As ADODB.Connection
Dim dbRst2 As ADODB.Recordset
Set dbConn2 = New ADODB.Connection
dbConn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= R:myAccessDB.mdb"
I hate to bring another Audit Trail question to the table, but I am scratching my head for thelast day trying to get to get this work.
Link to original post: http://www.access-programmers.co.uk/forums/showthread.php?t=44231&highlight=audit+trail
Problem: I have a main form/subform. The mainform is based on a query of 2 tables with a lookup field. The subform is based on a query referencing the PK for one of the main form's tables.
I have gotten the audit trail to work on the subform, no problems there.
But I get an Error 3251 - Operation is not supported for this type of object.
When I press ok, the record is changed and saved. The memo field logs that a change has been made, but does not list what was changed or what it was changed from.
I have tried the following: Changing the lookup fields names as Lookup1, Lookup2...etc the changing the line of code to skip those fields along with tbAuditTrail.
I have tried adding a second module named different/changed function name and calling it...no luck
Creating a just a new main form and tring it...zilch
I read something about recordsetclone, but do not know exactly how to add this in the module to try.
Does anyone have any other suggestions/or solutions that I may try?
I have an orders Form with a subform for products. In the subform the user selects each product by first selecting the product category from a combo box, which filters the query for the second combo where they selects the product. Once this is done, I need the record to up date, but Access gives a run time error 3058: Index or primary cannt contain a null value.
In this case I belive the key field is the product_id form my 'order_detail_table' where this is a shared key.
I've been beating this to death (it's killing me!!) for a couple of weeks now and got nowhere. Maybe someone out there can have a look and see what my obvious mistake is ... (I've attached a cut down version of db with just tables, query and subform)
Hi guys I am creating maintenance form to update and add new records to department table. But when I try to edit department field in employee table. (I get the following error.I get same when try to add new record.)
Error: You cannot add or change a record becasue a related record is required in table department
http://i5.photobucket.com/albums/y1...gdepartment.jpg ==> pic of error errroupdatingdepartment
I be happy if some expert help me how to update and add new record to department table successfully without the above error and without changing the db structure. Thanks
I have a linked table to a DB2 database. this table contains key-pair values and has about 140k records.
I use a Sub to update the value of a specific record.
The sub starts by opening the needed DAO recordset Then it uses the rs.Findfirst method It checks if rs.Nomatch is not true (so the records exists!) Then it starts updating the record with rs.edit rs!value1 = myvalue1, rs!value2 = myvalue 2 rs.Update There is where I get the '3021 No current record' error
I use the same sub on the same table to update to different parts. One part works the other gives me the error.
I have a form with various fields, some of which are normal data entry fields, others dynamically updating combo boxes.
My first field is a date field which defaults to today's date, the field following this is a growing combo box which requires some narrative to be entered. I have set up this combo box so as when data is entered into the combo box, the combo box will store it, allowing that entry to be used again. I achieve this with the Got Focus property Me.Refresh.
An error occurs when the user wishes to change the date from the default to another date. When I tab to the narrative field, Access informs me that the error occurs with the Me.Refresh property of the narrative field. I want to keep this property to allow me to update the combo box entries but I can't keep allowing this error to occur.
Does anyone know how I could solve this problem/get around it?
Hi, I have a table that uses SerialNo as primary key. From time to time (its a long story...) I need to go in and update the SerialNo by adding x to it. Here's the problem: lets say the table has SerialNo's 1,2,3,4,5, and I try to add 1. I get 4 KV error's because of course, 2,3,4,5 already exist in the table. (So I would end up with 1,2,3,4,6 instead of 2,3,4,5,6.)
I really thought that Access should be smart enough to figure out that there really won't be any key violations after the updates are done, but I guess not.
I have 5 check boxes on a form and one of them must be checked in order to get the correct result. If the user does not check any of the the five checkboxes he gets a msgbox telling him that he must checks one of the checkboxes.
What i want to ask is if is possible to prevent the form from updating? Because the user gets the error message but after that the form is being updated even though he hasn't check any of the fields.
I have a list (table) that I've created in sharepoint 2010.I link to the sharepoint table with Access 2010 to update mass amounts of items at once. Some of the queries have no problem updating the sharepoint items, but other queries require me to "Enter Paramater Value."
In this particular queries; I'm trying to populate field A with dates from field B, when field A is null.
--------------------- UPDATE Table 1 SET Table.[FieldA] = [FieldB] WHERE (((Table 1.[FieldA]) Is Null)); --------------------
When I run the above, I receive the "Enter Parameter Value" input box.All records have Field B populated (it's actually the created date.)
The goal is for field A to be populated with the values in Field B, without the query asking for parameters.
Note; I can go in each individual record and update them via access, one at a time. But it's the running of the update query that failing.
Greetings, I have a form with a subform(sub1) that contains records. Also on the parent form is a subform that contains subtotals of the records on the (sub1) subform. When I add a record to the (sub1) form, I can't get the code to update on the subtotal subform unless I go to another record. what am I missing here?
Is there any way to update the same record from two forms? The requirement is that in a form I have a checkbox. If I select the checkbox, it will open another form, in which I can update some fields which are of the same record. When I tried, it is updating on another record. Is that possible to do so?
i am attaching a sample db . If anyone knows how to do it, please update the sample db or give me advice.
I have one table (call it tblMax) which holds a number designating a maximum amount for items. I have a second table (call it tblItem) which holds the items current inventory, along with several other values about the item. Is there a way to reference fields from both of these tables on one form, AND have the record be able to update? I've used a query to bring them all to one form, but the record is not able to update using that method. The tblMax will be used for reference only, after the initial values are entered. I also tried leaving the form's Control Source blank and typing in Control Sources for each field, but was unable to get that to work. TIA.
Ok so ive built a form that a user can use to enter in data that will update a certain table.
The table has for fields: Email, Password, Active and ID.
In my form ive got rid of the active and ID fields as i want them to update automatically when the user fills in the email and password and hits the submit button on the form.
The only problem im having is getting my head around how i would update my other two fields once the user clicks submit?!
i was thinking that i could simply code the submit button to add the relevant info into the fields eg onclick active = 1 and ID = previous id +1 but im completely lost
on my form i have a few radio buttons, check boxes, text fields and combo boxes. i am able to change and update all fields except combo boxes. it modifies the wrong table...
combo_table ------------ id value 1 house 2 school 3 work if on my form the combo box for a specific record shows house selected, the value of 1 (the id from combo_table) should be the value put in the main talbe...if this is changed to option 2, school, the main table should have 2 in that field...
what happens though, is if i change from 1 (house) to 2 (school) combo_table ends up looking like the following:
combo_table ------------ id value 1 house 2 house 3 work
I am using and UPDATE Sql statement to update a firld in a form to a table. However, I get the message updating 140 records etc. How can I get the SQL/Macro to simply update teh record I am currently working on?
I constructed a database in access 2007, when you entered a new record the autonumber would be generated once you started typing in values. I have since upgraded it to an SQL back end and now the autonumber does not update until the recordset is completely entered. This is causing me serious problems with my subforms since the record will not update before I need to go to the subform.
I have a database containing 3 tables (for now): Customers Orders Catagories
Now i also have a form with customer information. In that form is a listbox with a query statement, so that should display wich orders are placed by that customer.
SELECT Orders.[Order-ID], Orders.Description, Orders.Date, Orders.Category FROM Orders WHERE Customer=[Customer-ID];
Now this works for the first costumer record being displayed. However when i view the next costumer, the listbox still displays the order information from the first customer.
How can i get the listbox to update itself when a diffirent record is viewed?
However on the form, LineMachine is taken from the tblLineMachine where LineID and MachineID are FKs. This has a large list of machines as one line can have many machines and a machine may appear on more than one line
So on the form, i would like to select the LineMachineID by inserting fldLineID (which would be a combo box) where the user could select which line e.g. Line1 and then the combo box for the LineMachineID would only display the relevant machines for the entered line instead of all the machines for every line.
I managed to achieve this,but I am experiencing a problem where if, in the Line combo box, i choose a different Line e.g. Line2, the LineMachineID does not then display the machines on Line2, but keeps showing the machines for the line I originally selected (Line 1).
How do I get the LineMachineID combo box to update every time a different line is chosen in the LineID combo box?
I have a form (frmHourEnter) with a textbox (Week_No_Calc) which has a calculation, in Control Source, based on another textbox. After exiting from Week_No_Calc how can I get a field (Week_No) in table (tblHourEnter) to be updated with the calculated value?
I have a form that has a main for, a subform, and then another subform inside the 1st subform. The form works like this:
Conact info --->Call info and notes ---> Orders worked
Each of those being nested as they appear. The problem is, the user usually jumps strait to putting the order number in "Orders worked" before entering in any notes or info... So no record exists in it's parent form to tie to. How can I have the database create a new record in its parent form when the user types in the subform?
I'm trying to update an imported table from an excel spreadsheet with missing details. The table's records are in order so I just need to fill in a blank field with data based on the previous one as shown.
ID Name Location 1 Bob London 2 Larry 3 Harry 4 Jerry Glasgow 5 Paul 6 John Southampton
I need to fill in the location blanks simply with the last location details, so records 2 and 3 with London and 5 with Glasgow. Is this easily done or would I need to pull all the data into an array and work on it there?
I've tried searching for an answer but haven't had any luck.
I have a form in which old customers can be edited and new customers can be added. Currently, to edit a customer, the user clicks in the "Last Name" field and then selects EDIT-FIND and types in the last name. The user will then cycle through all customers with that name to select the correct one. How do I allow a user to begin typing in the last name field and have the name appear? Is there an easier way to do this?
In access (2003) I am setting up a table with Employee # (Pri. Key), senority numbers..and so on. However I cannot figure out how to reset the senority numbers when one leaves. For example Bob is #235 senority and leaves (By retiring, quits or gets fired)..well Mary was #236 and now should be #235 (because Bob is no longer at the company)..and so on with everyone else below Bob getting their Senority number changed by one.> Do you have any ideas..I tried autonumber, but it will not do that.