Unable to Save Record

gsrajan

Registered User.
Local time
Today, 08:26
Joined
Apr 22, 2014
Messages
227
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] & "'"
Set Rst = dBS.OpenRecordset(Listsql)
Me.RecordSource = Listsql
Form.Refresh
dBS.Close
Set dBS = Nothing
End Sub

Please help.

Thank you.
 
When in debug mode what value is shown if you move the cursor over:
[Forms]![MASTERFORM]![ListSearch]
 
It is

Me.Recordsource="Select*from Masterdata where employeeid='"220141'"

Thank you
 
Kindly ignore my post. I found the reason. There was a code in the form - before update. I removed. It works fine now.

Thank you
 

Users who are viewing this thread

Back
Top Bottom