Forms :: Unable To Edit / Save Record - Runtime Error 2107
Apr 30, 2014
My database was working fine. Now, if I have to save or edit a record, I get a message Run time error 2107. The value you entered does not meet the validation rule defined for the field or control. I am able to enter and edit new records in the table. I did not change any validation in form. Then it goes to debug mode and highlighted this code (me.recordsource=Listsql - is highlighted)
Private Sub ListSearch_Click()
Dim dBS As Database
Dim Rst As Recordset
Dim Listsql As String
Set dBS = CurrentDb()
Listsql = "Select * from MasterData where employeeid ='" & [Forms]![MASTERFORM]![ListSearch] & "'"
I have a form that has a drop-down box. When the form opens, all the records are shown. Once a name is selected from the drop-down, only the records associated with that name are shown (a filter is created using code). The problem is that once the selection is made, I am unable to edit the records. I try to click in the fields but am unable to.
I have a main form with several subforms in tabs. From one of the subforms I list linked records to the main form (Clients) within that subform (Bank account details). I list the records and have a button to add new records.
Where the Client has one or more records in the subform the add button works perfectly.
When the subform has no records the add new records button produces the following error "Run-time error '2498' An expression you entered is the wrong data type for one of the arguments"
The add button has
Private Sub Command52_Click() DoCmd.OpenForm "AddClientBankDetailsFrm", acNormal, , , , acFormAdd, OpenArgs:=Me!ClientId End Sub
the "AddClientBankDetailsFrm" popup form has
Private Sub Form_Load() If IsNull(Me.OpenArgs) = False Then MsgBox "Form was opened with ClientID = " & Me.OpenArgs Me!ClientId = Me.OpenArgs Else MsgBox "No ClientID was passed." End If End Sub
ClientId is the primary key of the main form and the secondary key in the new record.
I have a access program and recently I began getting this Error out of the blue . I really need to fix this error because it shuts down my entire program . When I go to save a pic like i always do and it will not recognize the "quote Main ".
I have a problem where a user (with what I believe are the proper security settings) cannot save a new record in a form. I have set the securities on the form and the related table and query to allow this user to create new records (Add/Run).
This user is able to access the form and enter the data, but it will not save. I have added a "Save" button to no avail.
When I log on as the administrator, it works fine.
I get the subject run time error when I try to past a record. The error reads:
"The value you entered doesn't meet the validation rule defined for the field or control."
Then it takes me here in the VBA:
Private Sub cboEmployee_AfterUpdate() Me.RecordSource = "qryHours" Me.Refresh End Sub
More info: The form I am using is a continuous form. The record source for the form is "qryHours". The combo box "cboEmployee" is a drop down they use to select their name, which updates the form with the hours they have logged into the system.
Because the projects they work on are the same from week to week they would like to copy and past records, making keeping track of their time less time intensive.
ClientsID (PK) blah blah Information and Referral (a check box) blah blah blah blah
ClientIR (the form that opens up when I & R is checked)
IR ID (PK) ClientsID (FK to the above form) Requests (a lookup referencing to IRCategory)
The code is set up so when the I R box is checked, form will open, and unchecking it will delete the I R record of that Client.
The problem is when the IR Box is already open, the request has been selected, I cannot save it as Access says a record is required in the Clients form. There are only two buttons, one goes on to next requests (one client can have more than one requests), other saves and closes.
The Client form is already coded so it will save the Client's record before opening the IR Form, and either button will save the IR record as well.
I had referential intergrity turned on. Turning it off only gave me weird results (I was able to input records, but Access didn't autofill the ClientID in the IR records, and looking at Clients returns a blank IR record)
I have setup a ComboBox on a form, Listed the PK of the table as the control source. Inserted the PK and many other field as the row source. When I go to select a record I get the error "control can not be edited, it's bound to a auto number field, "Asset_ID"
I have a field on a form that when a check box is checked then the date is populate in a AddDate field. The problem is if the user edits that field the changes do not save. Below is some of the code, how do I save the changes?
Code: Me.AddDate = Date If Me.Dirty Then 'Save any edits. Me.Dirty = False
I've been working on a database for work for the last few weeks and this forum has been a Godsend many times over, but now I have a problem that I can't find any reference to.
Using Access 2003, I have a form that uses 3 cascading combo boxes in the header to find a unique record, and a command button that brings up the rest of the record into unbound fields in the body of the form.
It works fine for finding records, but whenever I enter/change data on it, the record doesn't save. The navigation buttons at the bottom don't work - the Next/Previous record buttons are disabled, and the First/Last Record buttons do nothing.
Navigation buttons are enabled/activated in the properties.
I tried getting around this by creating a Save Record command button - first using the wizard, then using VBA code DoCmd.RunCommand acSaveRecord as advised by [missinglinq;696351], but this still doesn't save the changes.
I have an 'add new order' form which opens with all the fields blank and focus set to a combo box. The first thing the user must do is select a contract name or number from an unbound combo box. I then want the form to update and show all the relevant information in the form fields.
In the row source of the combo box I select all 3 fields from the same table (Project_Info). Only the contract number is visible all others are set to 0cm width in combo box properties.
In the afterupdate event I have the following code to set the field to the values from the select query
My code looks like this: [code] Private Sub ProjectContractNum_AfterUpdate() Dim sOrder_idSource As String Dim rs As Object ProjectName = ProjectContractNum.Column(1) proj_status = ProjectContractNum.Column(2)
End Sub [end code]
My SQL in rowSource looks like this: SELECT Project_Info.proj_name, Project_Info.proj_contract_no, Project_Info.proj_status FROM Project_Info;
Access tells me that I don't have a join key in my record set. message reads as follows:- Run-time error '2147352567 (80020009)': Cannot add record(s);Join key of table Project_Info' not in record set.
Debug highlights this line: proj_status = ProjectContractNum.Column(2)
'proj_status' is the name of the text box and the control source.
If I just use just the first 2 fields (project number and project name) these two work!!
I have an unbound form: frm_ReceiptSearch with some fields that, when something is input, will search a datasheet viewed form on a subform on the main form (subform name is sf_frm_Receipts). Currently, on the txt_CheckNo field's after update event, I have the following code:
Private Sub txt_CheckNo_AfterUpdate() Dim SrchVar As String SrchVar = Me.txt_CheckNo Me!sf_frm_Receipts!REFNO.SetFocus DoCmd.FindRecord SrchVar, acEntire, , acSearchAll, , acCurrent, True End Sub
I currently have this set as the forms default recordsource (which works just fine):
Code: SELECT TOP 5 tblUsers_Phone_Book.EMAIL_ADDRESS, weightedDL('me@mine.com',[EMAIL_ADDRESS]) AS Expr1
And I have this vba to dynamically switch around that email address.
Code: Private Sub Form_Load() Dim intPos As Integer Dim strControlName As String Dim strValue As String Dim sSQL As String If Len(Me.OpenArgs) > 0 Then ' Position of the pipe
[Code] ....
If I msgbox the sSQL - it shows identical to the default recordsource but I get the error:
The error message I get is:
Run-Time error '2580' The record source 'SELECT TOP 5 tblUsers_Phone_Book.EMAIL_ADDRESS, weightedDL('me@mine.com',[EMAIL_ADDRESS]) AS Expr1' specified on this form or report does not exist.
I tried copying the exact working default sql into the vba and get the same result.
We have a database stored on a network drive used by a number of people across the organization over a Windows XP Network. I have an strange issue where some users get the error attached when trying to amend a record. However other users are able to amend the very same records. All the relevant user/windows permissions are identical. There is no security/permissions settings on the database for it to behave in this manner. The record seems to lock itself the moment you try to edit it.
I have a Main form (MainForm) with two subforms (SFormA, SFormB). These SForms are connected to the MainForm by a control (controlA) and connected to each other by a control (controlB) via an unbound control in the main form, in order to change data in SFormB according to selected record in SFormA. SFormB has an on current event procedure determined to show different things depending on the value of a bound control that changes every time I select a different record in SFormA. Everything works fine when Mainform and SForms first load.
But, when I select a record on SFormA I get a runtime error and everything stops, application closes and reopens, creating a safety copy. It seems to me that the on current procedure on SFormB causes this problem, because if I delete it no error appears (SFormB not showing what I want though). Funny thing is I have another database, same design, same structure, same procedures, (different objects and names of course) and it works perfectly alright. I even recreated the whole database still the same error.
While I have developed many databases using other RDBMSs I'm afraid I'm something of an Access 2007 newbie so the vast bulk of my experience counts for nought given Access' many "unique features".
What I have is a form with about 3 text fields, 2 date fields and a number of comboboxes on it. Although, for now I'm not worrying about the combo boxes until I get the other fields working.
I am trying to develop an update screen where the user types the primary key value for a record into the first field and using DLookup retrieve the other values from the table and insert them into the form so the user can adjust them if they wish and click the Save button to write the changes back to the table. That's the theory.
Unfortunately the reality is, although the values added to the other fields using DLookup are "there" they don't appear on the screen until the controls lose focus. My best guess is because they are being added programatically and no Return key is being pressed, focus will not change and they will never appear.
So to get around this I put a line of code in the GotFocus event of each control to move focus on to the next control, effectively "looping" the focus once around the controls. This worked well until the focus was being moved from the second last control to the last control when I got, Runtime error 2110: Can't move focus to this control. The control was visible and enabled, as was a dummy control I tacked on the end to see what happened.
Main code block in Exit event of first field:
Private Sub Text6_Exit(Cancel As Integer) Dim varItemType, varItemTypeCode, varItemClass, varItemClassCode, varDescription As Variant Dim varPurchaseDate, varWarrantyEnd As Variant Dim varItemTypeTxt As AcTextFormat Dim PurchaseDateSQL As String
I was trying from a button on my form that will go to and bring up the desktop. I want it so I can put this database on anyone's computer and the button will work.
I am using this and it works but only on my computer.
Application.FollowHyperlink "C:UsersBryanDesktop"
I also tried this
Application.FollowHyperlink "C:Show Desktop.scf" And Application.FollowHyperlink "C:WINDOWSSystemShow Desktop.scf"
Both gives Runtime error 490 cannot open specified file.
Run into a bit of an issue with a combo box that has dates. When I click on a date I receive:
Run-time error '3464': 'Data type mismatch in criteria expression'
Am I receiving this because I have declared it a string when I should declare it something else?
My other question for whenever I get the first part fixed. Is there a way that instead of having all the possible dates to select from, that I could simply have three options available: Within a year, More than a year, and no date. (Once I click on one of those three options, I will filter records that have a date within the past year, over a year, or no date at all. How would I be able to achieve this?
We are using access 97 and I have a linked table to sql 2000. A couple of weeks ago, our sql server crashed and we had to completely rebuild it / restore all of the data. Ever since then, only one of our linked sql tables in access is acting up. Whenever we go to edit a line (sometimes, not always), we get an error which states the following:
This record has been changed by another user since you started editing it. If you save the record, you will overwrite the changes the other user made. Copying the changes to the clipboard will let you look at the values the other user entered, and then paste your changes back in if you decide to make changes.
Options are Save Record (greyed out), Copy to Clipboard, and Drop Changes.
About all I have tried is re-linking the table...any other ideas?
I have been working on a bound form that I can't seem to get working.
It records deliveries and what I am trying to achieve is after the form has been filled in the user will click a save button where the record will be added to the table and a record automatically printed via a report and emailed to the shop manager, but i keep getting the error "No Current record" no matter what way I try to do it, I have tried using to run the report. Is the best way for me to accomplish this o change it to an unbound for and run an insert query on click?
I have attached a copy of what I have been working on : DatabaseDelivery.accdb
I have a form that has a button that calls the following code:
Sub ClosePO_Click() Dim db As DAO.Database Dim mvalue As String, strSql as string Set db = CurrentDb mvalue = Me.Combo73 'combo box on OpenPO Form strSql = "UPDATE Print SET OpenPO = NO where [GPO Invoice Number] = '" & mvalue & "'" Debug.Print strSql db.Execute dbFailOnError db.Close Set db = Nothing End Sub
When I run (or step through the code, I get the Run-Time Error 3078 ... database cannot find the input table.However, when I copy the debug.print output in the immmediate window and paste into the query builder, the query runs. Here is an example of the debug.print output:
UPDATE [Print] set OpenPO = NO where [GPO Invoice Number] = '40333' where OpenPO is a yes/no field and [GPO Invoice Number] is a string
I have a form that using "Query A" as data source. The Form need add (edit) a field value before save that Query Result to another Tabel. Is it possible to do that?
The PROCESS simply like below: Tabel A --> Query A --> Form -->Edit value a field -->Save to Tabel B
if it is possible, are there some requirements that have to be fullfilled?