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.
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.