Ms Access Runtime Error 2107
Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rating: Display Modes 04-07-2008, 09:27 AM #1 SeaRox Registered User Join Date: Apr 2008 Posts: 29 Thanks: 0 Thanked 0 Times in 0 Posts run time error 2107 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. Any ideas? SeaRox View Public Profile Find More Posts by SeaRox 04-07-2008, 09:57 AM #2 SeaRox Registered User Join Date: Apr 2008 Posts: 29 Thanks: 0 Thanked 0 Times in 0 Posts I think it has something to do with how everything is linked. (or not linked) because when I create a new record it doesn't get linked to the employee. SeaRox View Public Profile Find More Posts by SeaRox 04-07-2008, 10:02 AM #3 boblarson Former Moderator Join Date: Jan 2001 Location: Oregon, USA Posts: 32,482 Thanks: 94 Thanked 1,781 Times in 1,565 Posts Why are you trying to set the form's recordsource each time the combo is used. You shouldn't be doing that. Just requery the form (not REFRESH) Me.Requery __________________ Free tools, code and samples here: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. boblarson View Public Profile Visit boblarson's homepage! Find More Posts by boblarson 04-07-2008, 10:08 AM #4 SeaRox Registered User Join Date: Apr 2008 Posts: 29 Thanks: 0 Thanked 0 Times in 0 Posts I was able to fix the linking issue and I changed the code to this: Private Sub cboEmployee_AfterUpdate() Me.Requery End Sub but it gives me a new error when I try to copy and paste records (below). I found that the paste works
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Error 2107 The value you entered doesn't meet the validation rule defined for the field or control Want to Advertise Here? Solved Error 2107 The value you entered doesn't http://www.access-programmers.co.uk/forums/showthread.php?t=147054 meet the validation rule defined for the field or control Posted on 2006-10-17 MS Access 1 Verified Solution 24 Comments 1,757 Views Last Modified: 2012-06-27 Hi Experts, I have a simple form in access that has a field for ssn# when it loses focus I need it to execute this code: Private Sub pca_ssn_LostFocus() Dim sqlStr As String https://www.experts-exchange.com/questions/22027935/Error-2107-The-value-you-entered-doesn't-meet-the-validation-rule-defined-for-the-field-or-control.html Dim ssn As String ssn = Forms![dbName].pca_ssn.Text sqlStr = "SELECT count(dbName.pca_ssn) FROM PCA_Banned WHERE dbName.pca_ssn = =""" & ssn & """;" Me.RecordSource = sqlStr Me.Requery End Sub when I run the form I get a Error 2107 "The value you entered doesn't meet the validation rule defined for the field or control." The funny thing is I have no validation rules defined. The only thing special about this field is that its an identity and it has a input mask for ssn on the form field and the db field definition. What am I doing wrong? 0 Question by:dbedoo Facebook Twitter LinkedIn Google LVL 34 Best Solution byjefftwilley dim rs as dao.recordset dim sqlStr as string sqlStr = "SELECT * FROM PCA_Banned WHERE pca_ssn = """ & ssn & """;" set rs = currentdb.openrecordset(sqlStr) if rs.eof then NO RECORD EXISTS....Do Go to Solution 24 Comments LVL 65 Overall: Level 65 MS Access 42 Message Active today Expert Comment by:Jim Horn2006-10-17 >sqlStr = "SELECT count(dbName.pca_ssn) FROM PCA_Banned WHERE dbName.pca_ssn = =""" & ssn & """;" {Knee-jerk reaction, assmumi
first visit, be sure to check out the FAQ by clicking the link above. You may have to register before http://www.vbforums.com/showthread.php?546981-RunTime-Error-2107 you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 6 of 6 Thread: RunTime Error 2107 Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded ms access Mode Nov 14th, 2008,09:37 AM #1 TedMosby View Profile View Forum Posts Thread Starter Addicted Member Join Date Nov 2008 Location Manchester Posts 196 RunTime Error 2107 I am getting the RunTime Error 2107 "The value you entered doesn't meet the validation rule defined for the field or control" When I try and run my code below. ms access runtime What happens is the first time the cmdAddNew_Click() runs it works well and creates my record. I can input all the form and then run the Submit_Click() which then UPDATES the record created in the DB. At the end of this routine it will then clear the TextBox's or the Combo's (these are all bound) which works great but the problem is the txtNHSNo which is unbound and is the problem as when I click on the AddNew it falls over and debugs on line Code: Me.RecordSource = sQRYI dont understand why it would do this, all I want to do is clear the form for a fresh input. Code: Private Sub cmdAddNew_Click() Dim varInput As Variant Dim rs As DAO.Recordset Dim sQRY As String '************************************** varInput = InputBox("Enter the NHS Number", "Add new Data") If varInput = "" Then Exit Sub Set rs = CurrentDb.OpenRecordset("SELECT jez_SWM_InputDetails.* FROM jez_SWM_InputDetails WHERE jez_SWM_InputDetails.PersonalID = 1 ", dbOpenDynaset, dbSeeChanges) rs.AddNew rs.Fields![NHSNo] = varInput rs.Update rs.Close Set rs = Nothing '****